Repository: editorconfig-checker/editorconfig-checker
Pull request #392 (2024-10-13 21:22:46)

chore: rename our own .ecrc to the new name
Seems like we totally forgot to actually rename our own config to the new name, so here that change is.

klaernie: oh, that linter is not happy.. I'll have to fix that
codecov[bot]: ## [Codecov](https://app.codecov.io/gh/editorconfig-checker/editorconfig-checker/pull/392?dropdown=coverage&src=pr&el=h1&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=editorconfig-checker) Report
All modified and coverable lines are covered by tests :white_check_mark:
> Project coverage is 86.89%. Comparing base [(`10f16fc`)](https://app.codecov.io/gh/editorconfig-checker/editorconfig-checker/commit/10f16fc843581773830f0cbf3a3f8c285ee1edc3?dropdown=coverage&el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=editorconfig-checker) to head [(`f196e16`)](https://app.codecov.io/gh/editorconfig-checker/editorconfig-checker/commit/f196e1652f8514164b69a4ee107319da43aa7c2f?dropdown=coverage&el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=editorconfig-checker).

<details><summary>Additional details and impacted files</summary>


```diff
@@           Coverage Diff           @@
##             main     #392   +/-   ##
=======================================
  Coverage   86.89%   86.89%           
=======================================
  Files          10       10           
  Lines         702      702           
=======================================
  Hits          610      610           
  Misses         63       63           
  Partials       29       29           
```

</details>

[:umbrella: View full report in Codecov by Sentry](https://app.codecov.io/gh/editorconfig-checker/editorconfig-checker/pull/392?dropdown=coverage&src=pr&el=continue&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=editorconfig-checker).   
:loudspeaker: Have feedback on the report? [Share it here](https://about.codecov.io/codecov-pr-comment-feedback/?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=editorconfig-checker).

klaernie: Now everything is happy again!

Patch:
diff --git a/.ecrc b/.ecrc
deleted file mode 100644
index 1a3dedd..0000000
--- a/.ecrc
+++ /dev/null
@@ -1,22 +0,0 @@
-{
-  "Version": "v3.0.3",
-  "Verbose": false,
-  "Debug": false,
-  "IgnoreDefaults": false,
-  "SpacesAfterTabs": false,
-  "NoColor": false,
-  "exclude": [
-    "testfiles",
-    "testdata"
-  ],
-  "AllowedContentTypes": [],
-  "PassedFiles": [],
-  "Disable": {
-    "EndOfLine": false,
-    "Indentation": false,
-    "InsertFinalNewline": false,
-    "TrimTrailingWhitespace": false,
-    "IndentSize": false,
-    "MaxLineLength": false
-  }
-}
diff --git a/.editorconfig-checker.json b/.editorconfig-checker.json
new file mode 100644
index 0000000..139cdc6
--- /dev/null
+++ b/.editorconfig-checker.json
@@ -0,0 +1,22 @@
+{
+    "Version": "v3.0.3",
+    "Verbose": false,
+    "Debug": false,
+    "IgnoreDefaults": false,
+    "SpacesAfterTabs": false,
+    "NoColor": false,
+    "exclude": [
+        "testfiles",
+        "testdata"
+    ],
+    "AllowedContentTypes": [],
+    "PassedFiles": [],
+    "Disable": {
+        "EndOfLine": false,
+        "Indentation": false,
+        "InsertFinalNewline": false,
+        "TrimTrailingWhitespace": false,
+        "IndentSize": false,
+        "MaxLineLength": false
+    }
+}


Test patch:
diff --git a/pkg/config/config_test.go b/pkg/config/config_test.go
index abbd970..38ec47a 100644
--- a/pkg/config/config_test.go
+++ b/pkg/config/config_test.go
@@ -8,8 +8,8 @@ import (
 	"testing"
 )
 
-var rootConfigFilePath = []string{"../../.ecrc"}
-var configWithIgnoredDefaults = []string{"../../testfiles/.ecrc"}
+var rootConfigFilePath = []string{"../../.editorconfig-checker.json"}
+var configWithIgnoredDefaults = []string{"../../testfiles/.editorconfig-checker.json"}
 
 func TestNewConfig(t *testing.T) {
 	actual, _ := NewConfig([]string{"abc"})
@@ -89,7 +89,7 @@ func TestGetExcludesAsRegularExpression(t *testing.T) {
 }
 
 func TestMerge(t *testing.T) {
-	c1, err := NewConfig([]string{"../../.ecrc"})
+	c1, err := NewConfig([]string{"../../.editorconfig-checker.json"})
 	if err != nil {
 		t.Errorf("Expected to create a config without errors, got %v", err)
 	}
@@ -102,7 +102,7 @@ func TestMerge(t *testing.T) {
 	mergeConfig := Config{}
 	c1.Merge(mergeConfig)
 
-	c2, _ := NewConfig([]string{"../../.ecrc"})
+	c2, _ := NewConfig([]string{"../../.editorconfig-checker.json"})
 	_ = c2.Parse()
 
 	if !reflect.DeepEqual(c1, c2) {
@@ -151,14 +151,14 @@ func TestMerge(t *testing.T) {
 		t.Errorf("Expected, got %#v and %#v", c1, &expected)
 	}
 
-	config := Config{Path: "./.ecrc"}
+	config := Config{Path: "./.editorconfig-checker.json"}
 	err = config.Parse()
 
 	if err == nil {
 		t.Errorf("Expected an error to happen when parsing an unexisting file, got %v", err)
 	}
 
-	config = Config{Path: "./../../testfiles/.malformed.ecrc"}
+	config = Config{Path: "./../../testfiles/.malformed.editorconfig-checker.json"}
 	err = config.Parse()
 
 	if err == nil {
@@ -167,7 +167,7 @@ func TestMerge(t *testing.T) {
 }
 
 func TestParse(t *testing.T) {
-	c, _ := NewConfig([]string{"../../testfiles/.ecrc"})
+	c, _ := NewConfig([]string{"../../testfiles/.editorconfig-checker.json"})
 	_ = c.Parse()
 
 	if c.Verbose != true ||
@@ -200,11 +200,11 @@ func TestSave(t *testing.T) {
 }
 
 func TestGetAsString(t *testing.T) {
-	c, _ := NewConfig([]string{"../../.ecrc"})
+	c, _ := NewConfig([]string{"../../.editorconfig-checker.json"})
 	_ = c.Parse()
 
 	actual := c.GetAsString()
-	expected := "Config: {ShowVersion:false Help:false DryRun:false Path:../../.ecrc Version:v3.0.3 Verbose:false Format: Debug:false IgnoreDefaults:false SpacesAftertabs:<nil> SpacesAfterTabs:false NoColor:false Exclude:[testfiles testdata] AllowedContentTypes:[text/ application/octet-stream application/ecmascript application/json application/x-ndjson application/xml +json +xml] PassedFiles:[] Disable:{EndOfLine:false Indentation:false InsertFinalNewline:false TrimTrailingWhitespace:false IndentSize:false MaxLineLength:false} Logger:{Verbosee:false Debugg:false NoColor:false} EditorconfigConfig:0x"
+	expected := "Config: {ShowVersion:false Help:false DryRun:false Path:../../.editorconfig-checker.json Version:v3.0.3 Verbose:false Format: Debug:false IgnoreDefaults:false SpacesAftertabs:<nil> SpacesAfterTabs:false NoColor:false Exclude:[testfiles testdata] AllowedContentTypes:[text/ application/octet-stream application/ecmascript application/json application/x-ndjson application/xml +json +xml] PassedFiles:[] Disable:{EndOfLine:false Indentation:false InsertFinalNewline:false TrimTrailingWhitespace:false IndentSize:false MaxLineLength:false} Logger:{Verbosee:false Debugg:false NoColor:false} EditorconfigConfig:0x"
 
 	if !strings.HasPrefix(actual, expected) {
 		t.Errorf("Expected: %v, got: %v ", expected, actual)