nebius/SWE-rebench-V2-PRs huggingface dataset:
Repository: editorconfig-checker/editorconfig-checker
Pull request #90 (2019-09-13 20:29:56)

fix: Correctly initialize logger


Patch:
diff --git a/CHANGELOG.md b/CHANGELOG.md
index 3202b63..a33fcfb 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -8,11 +8,12 @@
 ### Fixed
 * (Only care for not empty stringish passed files)[https://github.com/editorconfig-checker/editorconfig-checker/pull/88]
     Can lead to not correctly checking and aborting the program
+* (Correctly initialize logger)[https://github.com/editorconfig-checker/editorconfig-checker/pull/90]
+* (Correctly parse `--no-color`-flag)[https://github.com/editorconfig-checker/editorconfig-checker/pull/90]
 ### Security
 ### Misc
 * (Use go 1.13 in ci)[https://github.com/editorconfig-checker/editorconfig-checker/pull/89]
 
-
 ## [2.0.2] - 2019-08-19
 * (Update editorconfig-core-go to v2.1.1)[https://github.com/editorconfig-checker/editorconfig-checker/pull/77]
 
diff --git a/cmd/editorconfig-checker/main.go b/cmd/editorconfig-checker/main.go
index 7322abf..90b36fa 100644
--- a/cmd/editorconfig-checker/main.go
+++ b/cmd/editorconfig-checker/main.go
@@ -78,8 +78,6 @@ func init() {
 		}
 	}
 
-	c.Logger = logger.Logger{Verbosee: c.Verbose, Debugg: c.Debug, NoColor: c.NoColor}
-
 	currentConfig.Merge(c)
 }
 
diff --git a/pkg/config/config.go b/pkg/config/config.go
index 18811dc..37e71b9 100644
--- a/pkg/config/config.go
+++ b/pkg/config/config.go
@@ -142,6 +142,10 @@ func (c *Config) Merge(config Config) {
 		c.Debug = config.Debug
 	}
 
+	if config.NoColor {
+		c.NoColor = config.NoColor
+	}
+
 	if config.IgnoreDefaults {
 		c.IgnoreDefaults = config.IgnoreDefaults
 	}
@@ -167,7 +171,10 @@ func (c *Config) Merge(config Config) {
 	}
 
 	c.mergeDisabled(config.Disable)
-	c.Logger = config.Logger
+	c.Logger = logger.Logger{
+		Verbosee: c.Verbose || config.Verbose,
+		Debugg:   c.Debug || config.Debug,
+		NoColor:  c.NoColor || config.NoColor}
 }
 
 // mergeDisabled merges the disabled checks into the config


Test patch:
diff --git a/pkg/config/config_test.go b/pkg/config/config_test.go
index 5d1f1ed..3b9981f 100644
--- a/pkg/config/config_test.go
+++ b/pkg/config/config_test.go
@@ -85,6 +85,7 @@ func TestMerge(t *testing.T) {
 		Path:                "some-other",
 		Verbose:             true,
 		Debug:               true,
+		NoColor:             true,
 		IgnoreDefaults:      true,
 		SpacesAftertabs:     true,
 		Exclude:             []string{"some-other"},
@@ -104,9 +105,14 @@ func TestMerge(t *testing.T) {
 	mergeConfig.Exclude = []string{"testfiles", "some-other"}
 
 	expected := mergeConfig
+	expected.Logger.Verbosee = true
+	expected.Logger.Debugg = true
+	expected.Logger.NoColor = true
 
 	if !reflect.DeepEqual(c1, &expected) {
-		t.Errorf("Expected, got %v and %v", c1, &expected)
+		t.Errorf("%#v", &expected)
+		t.Errorf("%#v", c1)
+		t.Errorf("Expected, got %#v and %#v", c1, &expected)
 	}
 
 	config := Config{Path: "./.ecrc"}
Repository: editorconfig-checker/editorconfig-checker
Pull request #96 (2019-11-16 19:55:53)

fix: Indented line which ends after indendation should be valid
references #94


Patch:
diff --git a/pkg/validation/validators/validators.go b/pkg/validation/validators/validators.go
index e66907e..3de3e04 100644
--- a/pkg/validation/validators/validators.go
+++ b/pkg/validation/validators/validators.go
@@ -29,7 +29,7 @@ func Space(line string, indentSize int) error {
 		// match recurring spaces indentSize times - this can be recurring or never
 		// match either a space followed by a * and maybe a space (block-comments)
 		// or match everything despite a space or tab-character
-		regexpPattern := fmt.Sprintf("^( {%d})*( \\* ?|[^ \t])", indentSize)
+		regexpPattern := fmt.Sprintf("^( {%d})*( \\* ?|[^ \t]|$)", indentSize)
 
 		matched, _ := regexp.MatchString(regexpPattern, line)
 
@@ -51,7 +51,7 @@ func Tab(line string, config config.Config) error {
 		// OR
 		// match starting with a space followed by at least one non-whitespace character
 
-		regexpPattern := "^(\t)*( \\* ?|[^ \t])"
+		regexpPattern := "^(\t)*( \\* ?|[^ \t]|$)"
 
 		if config.SpacesAftertabs {
 			regexpPattern = "(^(\t)*\\S)|(^(\t)+( )*\\S)|(^ \\S)"


Test patch:
diff --git a/pkg/validation/validators/validators_test.go b/pkg/validation/validators/validators_test.go
index be498d6..272108e 100644
--- a/pkg/validation/validators/validators_test.go
+++ b/pkg/validation/validators/validators_test.go
@@ -147,6 +147,7 @@ func TestSpace(t *testing.T) {
 		// correct indented block comment, empty and non empty
 		{"     *", 4, nil},
 		{"     * some comment", 4, nil},
+		{"    ", 4, nil},
 	}
 
 	for _, tt := range spaceTests {
@@ -173,6 +174,7 @@ func TestTab(t *testing.T) {
 		{"", spacesForbidden, nil},
 		{"x", spacesForbidden, nil},
 		{"	x", spacesForbidden, nil},
+		{"	", spacesForbidden, nil},
 		{"		x", spacesForbidden, nil},
 		{"  	a", spacesForbidden, errors.New("Wrong indentation type(spaces instead of tabs)")},
 		{" *", spacesForbidden, nil},
Repository: editorconfig-checker/editorconfig-checker
Pull request #125 (2020-10-12 16:37:44)

chore: fix spelling error
'to' → 'too'


Patch:
diff --git a/pkg/validation/validators/validators.go b/pkg/validation/validators/validators.go
index 3236aec..0cf78c1 100644
--- a/pkg/validation/validators/validators.go
+++ b/pkg/validation/validators/validators.go
@@ -144,7 +144,7 @@ func LineEnding(fileContent string, endOfLine string) error {
 func MaxLineLength(line string, maxLineLength int) error {
 	length := len(line)
 	if length > maxLineLength {
-		return fmt.Errorf("Line to long (%d instead of %d)", length, maxLineLength)
+		return fmt.Errorf("Line too long (%d instead of %d)", length, maxLineLength)
 	}
 
 	return nil


Test patch:
diff --git a/pkg/validation/validators/validators_test.go b/pkg/validation/validators/validators_test.go
index 6f12cf1..7dcdbda 100644
--- a/pkg/validation/validators/validators_test.go
+++ b/pkg/validation/validators/validators_test.go
@@ -247,8 +247,8 @@ func TestMaxLineLength(t *testing.T) {
 		expected      error
 	}{
 		{"", 80, nil},
-		{"abc", 2, errors.New("Line to long (3 instead of 2)")},
-		{"   ", 2, errors.New("Line to long (3 instead of 2)")},
+		{"abc", 2, errors.New("Line too long (3 instead of 2)")},
+		{"   ", 2, errors.New("Line too long (3 instead of 2)")},
 		{"xx", 2, nil},
 	}
Repository: editorconfig-checker/editorconfig-checker
Pull request #132 (2020-10-28 17:10:35)

Ignore patch files by default.
I know you may be hesitant to let the default exclude list grow, but patch files are common in repositories and definitely should never be checked for editorconfig violations.

I am aware that I can use .ecrc or CLI options to explicitly exclude them (which I have in my repos).

Thanks!


Patch:
diff --git a/README.md b/README.md
index 02e759d..729196b 100644
--- a/README.md
+++ b/README.md
@@ -220,6 +220,7 @@ If you don't pass the `ignore-defaults` flag to the binary these files are exclu
 "\\.7z$",
 "\\.bz2$",
 "\\.log$",
+"\\.patch$",
 "\\.css\\.map$",
 "\\.js\\.map$",
 "min\\.css$",
diff --git a/pkg/config/config.go b/pkg/config/config.go
index a8067f3..d4a2498 100644
--- a/pkg/config/config.go
+++ b/pkg/config/config.go
@@ -42,6 +42,7 @@ var defaultExcludes = []string{
 	"\\.7z$",
 	"\\.bz2$",
 	"\\.log$",
+	"\\.patch$",
 	"\\.css\\.map$",
 	"\\.js\\.map$",
 	"min\\.css$",


Test patch:
diff --git a/pkg/config/config_test.go b/pkg/config/config_test.go
index 410d587..7d71fed 100644
--- a/pkg/config/config_test.go
+++ b/pkg/config/config_test.go
@@ -50,7 +50,7 @@ func TestGetExcludesAsRegularExpression(t *testing.T) {
 	}
 
 	actual = c.GetExcludesAsRegularExpression()
-	expected = `testfiles|yarn\.lock$|package-lock\.json|composer\.lock$|\.snap$|\.otf$|\.woff$|\.woff2$|\.eot$|\.ttf$|\.gif$|\.png$|\.jpg$|\.jpeg$|\.mp4$|\.wmv$|\.svg$|\.ico$|\.bak$|\.bin$|\.pdf$|\.zip$|\.gz$|\.tar$|\.7z$|\.bz2$|\.log$|\.css\.map$|\.js\.map$|min\.css$|min\.js$`
+	expected = `testfiles|yarn\.lock$|package-lock\.json|composer\.lock$|\.snap$|\.otf$|\.woff$|\.woff2$|\.eot$|\.ttf$|\.gif$|\.png$|\.jpg$|\.jpeg$|\.mp4$|\.wmv$|\.svg$|\.ico$|\.bak$|\.bin$|\.pdf$|\.zip$|\.gz$|\.tar$|\.7z$|\.bz2$|\.log$|\.patch$|\.css\.map$|\.js\.map$|min\.css$|min\.js$`
 
 	if actual != expected {
 		t.Errorf("expected %s, got %s", expected, actual)
Repository: editorconfig-checker/editorconfig-checker
Pull request #171 (2021-06-08 06:08:48)

feat: Exclude yarn 2 files by default (#170).
feat: Exclude yarn 2 files by default (#170). Add .yarn/, .pnp.cjs, and .pnp.js to the default excludes.

fix: Add $ to default exclude package-lock.json. This is more consistent with the rest of the default exclude patterns.


Patch:
diff --git a/README.md b/README.md
index 083a064..fbbebf3 100644
--- a/README.md
+++ b/README.md
@@ -196,9 +196,12 @@ add x y =
 
 If you don't pass the `ignore-defaults` flag to the binary these files are excluded automatically:
 ```
+"\\.yarn/",
 "yarn\\.lock$",
-"package-lock\\.json",
+"package-lock\\.json$",
 "composer\\.lock$",
+"\\.pnp\\.cjs$",
+"\\.pnp\\.js$",
 "\\.snap$",
 "\\.otf$",
 "\\.woff$",
diff --git a/pkg/config/config.go b/pkg/config/config.go
index c8515fa..bd06e90 100644
--- a/pkg/config/config.go
+++ b/pkg/config/config.go
@@ -16,9 +16,12 @@ var DefaultExcludes = strings.Join(defaultExcludes, "|")
 
 // defaultExcludes are an array to produce the correct string from
 var defaultExcludes = []string{
+	"\\.yarn/",
 	"yarn\\.lock$",
-	"package-lock\\.json",
+	"package-lock\\.json$",
 	"composer\\.lock$",
+	"\\.pnp\\.cjs$",
+	"\\.pnp\\.js$",
 	"\\.snap$",
 	"\\.otf$",
 	"\\.woff$",


Test patch:
diff --git a/pkg/config/config_test.go b/pkg/config/config_test.go
index 6f544e2..131b097 100644
--- a/pkg/config/config_test.go
+++ b/pkg/config/config_test.go
@@ -50,7 +50,7 @@ func TestGetExcludesAsRegularExpression(t *testing.T) {
 	}
 
 	actual = c.GetExcludesAsRegularExpression()
-	expected = `testfiles|yarn\.lock$|package-lock\.json|composer\.lock$|\.snap$|\.otf$|\.woff$|\.woff2$|\.eot$|\.ttf$|\.gif$|\.png$|\.jpg$|\.jpeg$|\.webp$|\.avif$|\.mp4$|\.wmv$|\.svg$|\.ico$|\.bak$|\.bin$|\.pdf$|\.zip$|\.gz$|\.tar$|\.7z$|\.bz2$|\.log$|\.patch$|\.css\.map$|\.js\.map$|min\.css$|min\.js$`
+	expected = `testfiles|\.yarn/|yarn\.lock$|package-lock\.json$|composer\.lock$|\.pnp\.cjs$|\.pnp\.js$|\.snap$|\.otf$|\.woff$|\.woff2$|\.eot$|\.ttf$|\.gif$|\.png$|\.jpg$|\.jpeg$|\.webp$|\.avif$|\.mp4$|\.wmv$|\.svg$|\.ico$|\.bak$|\.bin$|\.pdf$|\.zip$|\.gz$|\.tar$|\.7z$|\.bz2$|\.log$|\.patch$|\.css\.map$|\.js\.map$|min\.css$|min\.js$`
 
 	if actual != expected {
 		t.Errorf("expected %s, got %s", expected, actual)
Repository: editorconfig-checker/editorconfig-checker
Pull request #216 (2022-08-03 18:16:56)

fix: Fix typo in final EOL check error message
I think the intention of this error message is to show the absence of a final newline, so `no` makes much more sense than `new` to me.

mstruebing: Thank you very much for your contribution 🚀 

Patch:
diff --git a/pkg/validation/validators/validators.go b/pkg/validation/validators/validators.go
index 2e81dc5..e9c8d74 100644
--- a/pkg/validation/validators/validators.go
+++ b/pkg/validation/validators/validators.go
@@ -97,7 +97,7 @@ func FinalNewline(fileContent string, insertFinalNewline string, endOfLine strin
 	if endOfLine != "" && insertFinalNewline == "true" {
 		expectedEolChar := utils.GetEolChar(endOfLine)
 		if !strings.HasSuffix(fileContent, expectedEolChar) || (expectedEolChar == "\n" && strings.HasSuffix(fileContent, "\r\n")) {
-			return errors.New("Wrong line endings or new final newline")
+			return errors.New("Wrong line endings or no final newline")
 		}
 	} else {
 		regexpPattern := "(\n|\r|\r\n)$"


Test patch:
diff --git a/pkg/validation/validators/validators_test.go b/pkg/validation/validators/validators_test.go
index 9ad9648..f89c6b6 100644
--- a/pkg/validation/validators/validators_test.go
+++ b/pkg/validation/validators/validators_test.go
@@ -19,18 +19,18 @@ func TestFinalNewline(t *testing.T) {
 		{"x\r", "true", "cr", nil},
 		{"x\r\n", "true", "crlf", nil},
 
-		{"x", "true", "lf", errors.New("Wrong line endings or new final newline")},
-		{"x", "true", "cr", errors.New("Wrong line endings or new final newline")},
-		{"x", "true", "crlf", errors.New("Wrong line endings or new final newline")},
+		{"x", "true", "lf", errors.New("Wrong line endings or no final newline")},
+		{"x", "true", "cr", errors.New("Wrong line endings or no final newline")},
+		{"x", "true", "crlf", errors.New("Wrong line endings or no final newline")},
 
-		{"x\n", "true", "cr", errors.New("Wrong line endings or new final newline")},
-		{"x\n", "true", "crlf", errors.New("Wrong line endings or new final newline")},
+		{"x\n", "true", "cr", errors.New("Wrong line endings or no final newline")},
+		{"x\n", "true", "crlf", errors.New("Wrong line endings or no final newline")},
 
-		{"x\r", "true", "lf", errors.New("Wrong line endings or new final newline")},
-		{"x\r", "true", "crlf", errors.New("Wrong line endings or new final newline")},
+		{"x\r", "true", "lf", errors.New("Wrong line endings or no final newline")},
+		{"x\r", "true", "crlf", errors.New("Wrong line endings or no final newline")},
 
-		{"x\r\n", "true", "lf", errors.New("Wrong line endings or new final newline")},
-		{"x\r\n", "true", "cr", errors.New("Wrong line endings or new final newline")},
+		{"x\r\n", "true", "lf", errors.New("Wrong line endings or no final newline")},
+		{"x\r\n", "true", "cr", errors.New("Wrong line endings or no final newline")},
 
 		// insert_final_newline false
 		{"x", "false", "lf", nil},
Repository: editorconfig-checker/editorconfig-checker
Pull request #230 (2022-11-21 18:37:02)

feat(default-exclude): add Gemfile.lock to default exclude list
Adding `Gemfile.lock` to the list of default excludes since it's a generated file and it shouldn't be checked.


Patch:
diff --git a/.editorconfig b/.editorconfig
index aa8954d..0ab4535 100644
--- a/.editorconfig
+++ b/.editorconfig
@@ -1,18 +1,29 @@
 root = true
 
 [*]
-charset = utf-8
-insert_final_newline = true
-trim_trailing_whitespace = true
 indent_style = space
 indent_size = 4
 end_of_line = lf
+charset = utf-8
+trim_trailing_whitespace = true
+insert_final_newline = true
 
-[*.{go,mod}]
+[{*.go,go.mod}]
 indent_style = tab
+indent_size = unset
 
-[Makefile]
-indent_style = tab
+[*.{yaml,yml}]
+indent_size = 2
+
+[*.md]
+indent_size = unset
+
+[*.nix]
+indent_size = 2
 
-[*{.yml,.ecrc,.nix}]
+[.ecrc]
 indent_size = 2
+
+[Makefile]
+indent_style = tab
+indent_size = unset
diff --git a/pkg/config/config.go b/pkg/config/config.go
index e122e06..140b60f 100644
--- a/pkg/config/config.go
+++ b/pkg/config/config.go
@@ -21,6 +21,7 @@ var defaultExcludes = []string{
 	"^package-lock\\.json$",
 	"^composer\\.lock$",
 	"^Cargo\\.lock$",
+	"^Gemfile\\.lock$",
 	"^\\.pnp\\.cjs$",
 	"^\\.pnp\\.js$",
 	"^\\.pnp\\.loader\\.mjs$",


Test patch:
diff --git a/pkg/config/config_test.go b/pkg/config/config_test.go
index 9dc3edb..99dd36b 100644
--- a/pkg/config/config_test.go
+++ b/pkg/config/config_test.go
@@ -50,7 +50,7 @@ func TestGetExcludesAsRegularExpression(t *testing.T) {
 	}
 
 	actual = c.GetExcludesAsRegularExpression()
-	expected = `testfiles|testdata|^\.yarn/|^yarn\.lock$|^package-lock\.json$|^composer\.lock$|^Cargo\.lock$|^\.pnp\.cjs$|^\.pnp\.js$|^\.pnp\.loader\.mjs$|\.snap$|\.otf$|\.woff$|\.woff2$|\.eot$|\.ttf$|\.gif$|\.png$|\.jpg$|\.jpeg$|\.webp$|\.avif$|\.mp4$|\.wmv$|\.svg$|\.ico$|\.bak$|\.bin$|\.pdf$|\.zip$|\.gz$|\.tar$|\.7z$|\.bz2$|\.log$|\.patch$|\.css\.map$|\.js\.map$|min\.css$|min\.js$`
+	expected = `testfiles|testdata|^\.yarn/|^yarn\.lock$|^package-lock\.json$|^composer\.lock$|^Cargo\.lock$|^Gemfile\.lock$|^\.pnp\.cjs$|^\.pnp\.js$|^\.pnp\.loader\.mjs$|\.snap$|\.otf$|\.woff$|\.woff2$|\.eot$|\.ttf$|\.gif$|\.png$|\.jpg$|\.jpeg$|\.webp$|\.avif$|\.mp4$|\.wmv$|\.svg$|\.ico$|\.bak$|\.bin$|\.pdf$|\.zip$|\.gz$|\.tar$|\.7z$|\.bz2$|\.log$|\.patch$|\.css\.map$|\.js\.map$|min\.css$|min\.js$`
 
 	if actual != expected {
 		t.Errorf("expected %s, got %s", expected, actual)
Repository: editorconfig-checker/editorconfig-checker
Pull request #324 (2024-02-01 19:41:36)

feat: add .pnm, .pbm, .pgm and .ppm files extensions to default excludes
The PR adds more images formats to exclude by default.

You can read more about these formats here: https://netpbm.sourceforge.net/doc/pnm.html.

As they are binary files (if not using the plain version), they should be ignored.


Patch:
diff --git a/README.md b/README.md
index fab310f..0758b4f 100644
--- a/README.md
+++ b/README.md
@@ -252,6 +252,10 @@ If you don't pass the `ignore-defaults` flag to the binary these files are exclu
 "\\.jpeg$",
 "\\.webp$",
 "\\.avif",
+"\\.pnm",
+"\\.pbm",
+"\\.pgm",
+"\\.ppm",
 "\\.mp4$",
 "\\.wmv$",
 "\\.svg$",
diff --git a/pkg/config/config.go b/pkg/config/config.go
index 8a37db5..f1a0ab7 100644
--- a/pkg/config/config.go
+++ b/pkg/config/config.go
@@ -39,6 +39,10 @@ var defaultExcludes = []string{
 	"\\.jpeg$",
 	"\\.webp$",
 	"\\.avif$",
+	"\\.pnm$",
+	"\\.pbm$",
+	"\\.pgm$",
+	"\\.ppm$",
 	"\\.mp4$",
 	"\\.wmv$",
 	"\\.svg$",


Test patch:
diff --git a/pkg/config/config_test.go b/pkg/config/config_test.go
index fa2778d..d488504 100644
--- a/pkg/config/config_test.go
+++ b/pkg/config/config_test.go
@@ -53,7 +53,7 @@ func TestGetExcludesAsRegularExpression(t *testing.T) {
 	}
 
 	actual = c.GetExcludesAsRegularExpression()
-	expected = `testfiles|testdata|^\.yarn/|^yarn\.lock$|^package-lock\.json$|^composer\.lock$|^Cargo\.lock$|^Gemfile\.lock$|^\.pnp\.cjs$|^\.pnp\.js$|^\.pnp\.loader\.mjs$|\.snap$|\.otf$|\.woff$|\.woff2$|\.eot$|\.ttf$|\.gif$|\.png$|\.jpg$|\.jpeg$|\.webp$|\.avif$|\.mp4$|\.wmv$|\.svg$|\.ico$|\.bak$|\.bin$|\.pdf$|\.zip$|\.gz$|\.tar$|\.7z$|\.bz2$|\.log$|\.patch$|\.css\.map$|\.js\.map$|min\.css$|min\.js$`
+	expected = `testfiles|testdata|^\.yarn/|^yarn\.lock$|^package-lock\.json$|^composer\.lock$|^Cargo\.lock$|^Gemfile\.lock$|^\.pnp\.cjs$|^\.pnp\.js$|^\.pnp\.loader\.mjs$|\.snap$|\.otf$|\.woff$|\.woff2$|\.eot$|\.ttf$|\.gif$|\.png$|\.jpg$|\.jpeg$|\.webp$|\.avif$|\.pnm$|\.pbm$|\.pgm$|\.ppm$|\.mp4$|\.wmv$|\.svg$|\.ico$|\.bak$|\.bin$|\.pdf$|\.zip$|\.gz$|\.tar$|\.7z$|\.bz2$|\.log$|\.patch$|\.css\.map$|\.js\.map$|min\.css$|min\.js$`
 
 	if actual != expected {
 		t.Errorf("expected %s, got %s", expected, actual)
Repository: editorconfig-checker/editorconfig-checker
Pull request #427 (2025-01-18 15:02:49)

fix: improve default excludes
After reading through past issues, I came to the conclusion that we should exclude both `.git` (#268 ) and `node_modules` (#197) by default. 

ccoVeille: Another common exclude is "vendor" I think

Patch:
diff --git a/README.md b/README.md
index 8bc589b..693ae88 100644
--- a/README.md
+++ b/README.md
@@ -286,11 +286,14 @@ add x y =
 If you choose to [ignore them](#ignoring-default-excludes), these paths are excluded automatically:
 
 ```txt
+"\\.git[\\/]",
+"[\\/]node_modules[\\/]",
 "^\\.yarn/",
 "^yarn\\.lock$",
 "^package-lock\\.json$",
 "^composer\\.lock$",
 "^Cargo\\.lock$",
+"^Gemfile\\.lock$",
 "^\\.pnp\\.cjs$",
 "^\\.pnp\\.js$",
 "^\\.pnp\\.loader\\.mjs$",
@@ -305,11 +308,11 @@ If you choose to [ignore them](#ignoring-default-excludes), these paths are excl
 "\\.jpg$",
 "\\.jpeg$",
 "\\.webp$",
-"\\.avif",
-"\\.pnm",
-"\\.pbm",
-"\\.pgm",
-"\\.ppm",
+"\\.avif$",
+"\\.pnm$",
+"\\.pbm$",
+"\\.pgm$",
+"\\.ppm$",
 "\\.mp4$",
 "\\.wmv$",
 "\\.svg$",
@@ -327,7 +330,7 @@ If you choose to [ignore them](#ignoring-default-excludes), these paths are excl
 "\\.css\\.map$",
 "\\.js\\.map$",
 "min\\.css$",
-"min\\.js$"
+"min\\.js$",
 ```
 
 #### Ignoring Default Excludes
diff --git a/pkg/config/config.go b/pkg/config/config.go
index a26e18f..f632e12 100644
--- a/pkg/config/config.go
+++ b/pkg/config/config.go
@@ -21,6 +21,8 @@ var DefaultExcludes = strings.Join(defaultExcludes, "|")
 
 // defaultExcludes are an array to produce the correct string from
 var defaultExcludes = []string{
+	"\\.git[\\/]",
+	"[\\/]node_modules[\\/]",
 	"^\\.yarn/",
 	"^yarn\\.lock$",
 	"^package-lock\\.json$",


Test patch:
diff --git a/pkg/config/config_test.go b/pkg/config/config_test.go
index 8e01be1..9fd0c0a 100644
--- a/pkg/config/config_test.go
+++ b/pkg/config/config_test.go
@@ -86,7 +86,7 @@ func TestGetExcludesAsRegularExpression(t *testing.T) {
 	}
 
 	actual = c.GetExcludesAsRegularExpression()
-	expected = `testfiles|testdata|^\.yarn/|^yarn\.lock$|^package-lock\.json$|^composer\.lock$|^Cargo\.lock$|^Gemfile\.lock$|^\.pnp\.cjs$|^\.pnp\.js$|^\.pnp\.loader\.mjs$|\.snap$|\.otf$|\.woff$|\.woff2$|\.eot$|\.ttf$|\.gif$|\.png$|\.jpg$|\.jpeg$|\.webp$|\.avif$|\.pnm$|\.pbm$|\.pgm$|\.ppm$|\.mp4$|\.wmv$|\.svg$|\.ico$|\.bak$|\.bin$|\.pdf$|\.zip$|\.gz$|\.tar$|\.7z$|\.bz2$|\.log$|\.patch$|\.css\.map$|\.js\.map$|min\.css$|min\.js$`
+	expected = `testfiles|testdata|\.git[\/]|[\/]node_modules[\/]|^\.yarn/|^yarn\.lock$|^package-lock\.json$|^composer\.lock$|^Cargo\.lock$|^Gemfile\.lock$|^\.pnp\.cjs$|^\.pnp\.js$|^\.pnp\.loader\.mjs$|\.snap$|\.otf$|\.woff$|\.woff2$|\.eot$|\.ttf$|\.gif$|\.png$|\.jpg$|\.jpeg$|\.webp$|\.avif$|\.pnm$|\.pbm$|\.pgm$|\.ppm$|\.mp4$|\.wmv$|\.svg$|\.ico$|\.bak$|\.bin$|\.pdf$|\.zip$|\.gz$|\.tar$|\.7z$|\.bz2$|\.log$|\.patch$|\.css\.map$|\.js\.map$|min\.css$|min\.js$`
 
 	if actual != expected {
 		t.Errorf("expected %s, got %s", expected, actual)