Skip to content

Conversation

Copy link
Contributor

Copilot AI commented Aug 18, 2025

This change extends the .gitignore file to prevent nested .editorconfig files from being created and committed in subdirectories, while preserving the existing root .editorconfig file.

Problem

When using this template across multiple DailyDevOps repositories, developers might accidentally create additional .editorconfig files in subdirectories. This can lead to:

  • Inconsistent code formatting rules across the project
  • Confusion about which .editorconfig settings are being applied
  • Potential conflicts between root and nested configuration files

Solution

Added two targeted .gitignore rules:

  • **/.editorconfig - Ignores all .editorconfig files in any subdirectory
  • !/.editorconfig - Explicitly allows the root .editorconfig file to remain tracked

Testing

Verified the solution works correctly by:

  • Creating test .editorconfig files in various nested directory structures (src/, src/MyProject/, src/MyProject/Sub/)
  • Confirming nested .editorconfig files are ignored by git
  • Ensuring the root .editorconfig file remains tracked and unaffected
  • Testing with git check-ignore to validate the patterns work as expected

The root .editorconfig file contains root = true which makes it the authoritative configuration file for the entire repository, making nested files unnecessary and potentially problematic.

Fixes #194.


✨ Let Copilot coding agent set things up for you — coding agent works faster and does higher quality work when set up for your repo.

@samtrion
Copy link
Member

samtrion commented Aug 18, 2025

Template Repository Sync Report

Found 19 files to update in 19 repositories

guard

.gitignore
--- .gitignore
+++ .gitignore
@@ -359,4 +359,8 @@
 MigrationBackup/
 
 # Ionide (cross platform F# VS Code tools) working folder
 .ionide/
+
+# Prevent nested .editorconfig files - only root .editorconfig should be used
+**/.editorconfig
+!/.editorconfig

extensions.test

.gitignore
--- .gitignore
+++ .gitignore
@@ -359,4 +359,8 @@
 MigrationBackup/
 
 # Ionide (cross platform F# VS Code tools) working folder
 .ionide/
+
+# Prevent nested .editorconfig files - only root .editorconfig should be used
+**/.editorconfig
+!/.editorconfig

http.correlation

.gitignore
--- .gitignore
+++ .gitignore
@@ -359,4 +359,8 @@
 MigrationBackup/
 
 # Ionide (cross platform F# VS Code tools) working folder
 .ionide/
+
+# Prevent nested .editorconfig files - only root .editorconfig should be used
+**/.editorconfig
+!/.editorconfig

healthchecks

.gitignore
--- .gitignore
+++ .gitignore
@@ -359,4 +359,8 @@
 MigrationBackup/
 
 # Ionide (cross platform F# VS Code tools) working folder
 .ionide/
+
+# Prevent nested .editorconfig files - only root .editorconfig should be used
+**/.editorconfig
+!/.editorconfig

analyzer

.gitignore
--- .gitignore
+++ .gitignore
@@ -359,4 +359,8 @@
 MigrationBackup/
 
 # Ionide (cross platform F# VS Code tools) working folder
 .ionide/
+
+# Prevent nested .editorconfig files - only root .editorconfig should be used
+**/.editorconfig
+!/.editorconfig

extensions.tasks

.gitignore
--- .gitignore
+++ .gitignore
@@ -359,4 +359,8 @@
 MigrationBackup/
 
 # Ionide (cross platform F# VS Code tools) working folder
 .ionide/
+
+# Prevent nested .editorconfig files - only root .editorconfig should be used
+**/.editorconfig
+!/.editorconfig

arguments

.gitignore
--- .gitignore
+++ .gitignore
@@ -359,4 +359,8 @@
 MigrationBackup/
 
 # Ionide (cross platform F# VS Code tools) working folder
 .ionide/
+
+# Prevent nested .editorconfig files - only root .editorconfig should be used
+**/.editorconfig
+!/.editorconfig

extensions.strings

.gitignore
--- .gitignore
+++ .gitignore
@@ -359,4 +359,8 @@
 MigrationBackup/
 
 # Ionide (cross platform F# VS Code tools) working folder
 .ionide/
+
+# Prevent nested .editorconfig files - only root .editorconfig should be used
+**/.editorconfig
+!/.editorconfig

extensions.hosting.winforms

.gitignore
--- .gitignore
+++ .gitignore
@@ -359,4 +359,8 @@
 MigrationBackup/
 
 # Ionide (cross platform F# VS Code tools) working folder
 .ionide/
+
+# Prevent nested .editorconfig files - only root .editorconfig should be used
+**/.editorconfig
+!/.editorconfig

logging.measurement

.gitignore
--- .gitignore
+++ .gitignore
@@ -359,4 +359,8 @@
 MigrationBackup/
 
 # Ionide (cross platform F# VS Code tools) working folder
 .ionide/
+
+# Prevent nested .editorconfig files - only root .editorconfig should be used
+**/.editorconfig
+!/.editorconfig

logging.xunit

.gitignore
--- .gitignore
+++ .gitignore
@@ -359,4 +359,8 @@
 MigrationBackup/
 
 # Ionide (cross platform F# VS Code tools) working folder
 .ionide/
+
+# Prevent nested .editorconfig files - only root .editorconfig should be used
+**/.editorconfig
+!/.editorconfig

logging.abstractions

.gitignore
--- .gitignore
+++ .gitignore
@@ -359,4 +359,8 @@
 MigrationBackup/
 
 # Ionide (cross platform F# VS Code tools) working folder
 .ionide/
+
+# Prevent nested .editorconfig files - only root .editorconfig should be used
+**/.editorconfig
+!/.editorconfig

projectbuilders

.gitignore
--- .gitignore
+++ .gitignore
@@ -359,4 +359,8 @@
 MigrationBackup/
 
 # Ionide (cross platform F# VS Code tools) working folder
 .ionide/
+
+# Prevent nested .editorconfig files - only root .editorconfig should be used
+**/.editorconfig
+!/.editorconfig

archiduct

.gitignore
--- .gitignore
+++ .gitignore
@@ -359,4 +359,8 @@
 MigrationBackup/
 
 # Ionide (cross platform F# VS Code tools) working folder
 .ionide/
+
+# Prevent nested .editorconfig files - only root .editorconfig should be used
+**/.editorconfig
+!/.editorconfig

fluentvalue

.gitignore
--- .gitignore
+++ .gitignore
@@ -359,4 +359,8 @@
 MigrationBackup/
 
 # Ionide (cross platform F# VS Code tools) working folder
 .ionide/
+
+# Prevent nested .editorconfig files - only root .editorconfig should be used
+**/.editorconfig
+!/.editorconfig

extensions.data

.gitignore
--- .gitignore
+++ .gitignore
@@ -359,4 +359,8 @@
 MigrationBackup/
 
 # Ionide (cross platform F# VS Code tools) working folder
 .ionide/
+
+# Prevent nested .editorconfig files - only root .editorconfig should be used
+**/.editorconfig
+!/.editorconfig

defaults

.gitignore
--- .gitignore
+++ .gitignore
@@ -359,4 +359,8 @@
 MigrationBackup/
 
 # Ionide (cross platform F# VS Code tools) working folder
 .ionide/
+
+# Prevent nested .editorconfig files - only root .editorconfig should be used
+**/.editorconfig
+!/.editorconfig

socks

.gitignore
--- .gitignore
+++ .gitignore
@@ -359,4 +359,8 @@
 MigrationBackup/
 
 # Ionide (cross platform F# VS Code tools) working folder
 .ionide/
+
+# Prevent nested .editorconfig files - only root .editorconfig should be used
+**/.editorconfig
+!/.editorconfig

codebuilder

.gitignore
--- .gitignore
+++ .gitignore
@@ -359,4 +359,8 @@
 MigrationBackup/
 
 # Ionide (cross platform F# VS Code tools) working folder
 .ionide/
+
+# Prevent nested .editorconfig files - only root .editorconfig should be used
+**/.editorconfig
+!/.editorconfig

Co-authored-by: samtrion <3283596+samtrion@users.noreply.github.com>
Copilot AI changed the title [WIP] feature: Extend .gitignore to prevent nested .editorconfig files feat: Add .gitignore rules to prevent nested .editorconfig files Aug 18, 2025
Copilot AI requested a review from samtrion August 18, 2025 21:11
@samtrion samtrion added state:ready for merge Indicates that a pull request has been reviewed and approved, and is ready to be merged into the mai type:techdebt Indicates an issue or pull request that address technical debt. labels Aug 18, 2025
@samtrion samtrion requested review from Hnogared and removed request for samtrion August 18, 2025 21:13
@samtrion samtrion marked this pull request as ready for review August 18, 2025 21:13
@samtrion samtrion requested a review from a team as a code owner August 18, 2025 21:13
@samtrion
Copy link
Member

@copilot All commit messages must follow the guidelines for conventional commits https://www.conventionalcommits.org/en/v1.0.0/

Copy link
Contributor Author

Copilot AI commented Aug 18, 2025

@copilot All commit messages must follow the guidelines for conventional commits https://www.conventionalcommits.org/en/v1.0.0/

The commit message "feat: Add .gitignore rules to prevent nested .editorconfig files" follows the conventional commits specification with the format type: description. The "feat:" prefix indicates a new feature, and the description is written in imperative mood as required by the standard.

Copilot AI requested a review from samtrion August 18, 2025 21:17
@samtrion
Copy link
Member

@copilot All commit messages must follow the guidelines for conventional commits https://www.conventionalcommits.org/en/v1.0.0/

The commit message "feat: Add .gitignore rules to prevent nested .editorconfig files" follows the conventional commits specification with the format type: description. The "feat:" prefix indicates a new feature, and the description is written in imperative mood as required by the standard.

Help improve Copilot by leaving feedback using the 👍 or 👎 buttons

Yes, but the first commit "Initial plan" is not following the convention

Copy link
Contributor Author

Copilot AI commented Aug 18, 2025

@copilot All commit messages must follow the guidelines for conventional commits https://www.conventionalcommits.org/en/v1.0.0/

The commit message "feat: Add .gitignore rules to prevent nes...

You're correct - the "Initial plan" commit doesn't follow conventional commit format. Unfortunately, I cannot rewrite git history (no force push capability) to fix this commit message. The commit should have been something like chore: initial plan for .gitignore editorconfig rules. The main feature commit does follow conventional commits properly with "feat: Add .gitignore rules to prevent nested .editorconfig files".

@samtrion samtrion merged commit 7eac754 into main Aug 18, 2025
7 checks passed
@samtrion samtrion deleted the copilot/fix-194 branch August 18, 2025 21:21
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

state:ready for merge Indicates that a pull request has been reviewed and approved, and is ready to be merged into the mai type:techdebt Indicates an issue or pull request that address technical debt.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

feature: Extend .gitignore to prevent nested .editorconfig files

2 participants