0

I have a similar scenario as those described here and here: I want to have a single .editorConfig file, but be able to commit it to multiple repos (one to many). I have read that there are some issues with creating softlinks and symlinks on git, but I have not found much about hardlinks.

My questions:

  • Is this discouraged somehow? I understand that specific projects might have specific editorConfig requirements. Also, that changing one of the files will generate a git change in multiple repos, but this does not bother me, since I pretend the style to be consistent across my repos (I work mainly with c#).
  • Will it behave differently in different environments with git (linux, osx, windows)?
Jazz.
  • 458
  • 4
  • 12

1 Answers1

1

I had a similar situation too. I have a repository that contains the .editorconfig file. This repo is a single source of truth for coding guideline. I also have several (approximately 40) code repositories written by C#.

For local environment:

  • I always clone repositories to a specific folder. If this is related to my job, it goes into the work folder; or if this is my personal project, it goes into the personal folder, etc. I copy the .editorconfig file from the guideline repository to the same level as my repository folder. Thus, whole repositories can use a single/same .editorconfig file. I also have a specific .editorconfig file in the personal folder. So, I can override some repository rules like this. Maybe you do not like my copying approach, but I do not think these rules are changed often.

For continuous integration:

  • I never trust developers. They can ignore the error/warnings or they don't use IDE. For this case, I added a new task to my CI pipeline before the build step. This task clones the coding guideline repository and copies the .editorconfig file to the build directory. In this way, dotnet build command finds the .editorconfig file and uses it.

I know this is not a solid solution to your question but I wanted to give an idea.

dogukanarkan
  • 341
  • 2
  • 8