From edcd2b0b0eb514d04c13eb0b3c594604aa77e315 Mon Sep 17 00:00:00 2001 From: per1234 Date: Sat, 14 Aug 2021 20:44:49 -0700 Subject: [PATCH 1/2] Add editorconfig-checker config file to sync task The repository doesn't have any project-specific configurations for the editorconfig-checker tool, so the stock "template" `.ecrc` file can be used. This should be kept in sync automatically via the `config:sync` task and the "Check Configuration Files Sync" workflow. --- Taskfile.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/Taskfile.yml b/Taskfile.yml index e99b746d..e798b619 100644 --- a/Taskfile.yml +++ b/Taskfile.yml @@ -90,6 +90,7 @@ tasks: cmds: - | cp \ + "{{.WORKFLOW_TEMPLATE_ASSETS_PATH}}/check-general-formatting/.ecrc" \ "{{.WORKFLOW_TEMPLATE_ASSETS_PATH}}/general/.editorconfig" \ "{{.WORKFLOW_TEMPLATE_ASSETS_PATH}}/check-python/.flake8" \ "{{.WORKFLOW_TEMPLATE_ASSETS_PATH}}/check-markdown/.markdownlint.yml" \ From e0b0b7b5f295c6ac816cbaf1571c553435539b15 Mon Sep 17 00:00:00 2001 From: per1234 Date: Sat, 14 Aug 2021 20:29:07 -0700 Subject: [PATCH 2/2] Make editorconfig-checker exclude regexes explicit The `Exclude` array in the `.ecrc` configuration file contains the regular expressions of paths that should be excluded from checking by the editorconfig-checker tool. Previously, the "template" file contained a list of filenames that should always be ignored. Although it did work, it was not really correct because the `.` in the filename is actually a regex wildcard, which is not what was intended. Although a false match was unlikely, this also might mislead users adding project-specific exclusions to the file regarding the nature of the exclude patterns. Changing to very explicit patterns avoids any chance of false matches and also makes it clear that these are regexes. --- .ecrc | 4 ++-- workflow-templates/assets/check-general-formatting/.ecrc | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/.ecrc b/.ecrc index a0ef7686..888b8f03 100644 --- a/.ecrc +++ b/.ecrc @@ -1,6 +1,6 @@ { "Exclude": [ - "LICENSE.txt", - "poetry.lock" + "^LICENSE\\.txt$", + "^poetry\\.lock$" ] } diff --git a/workflow-templates/assets/check-general-formatting/.ecrc b/workflow-templates/assets/check-general-formatting/.ecrc index a0ef7686..888b8f03 100644 --- a/workflow-templates/assets/check-general-formatting/.ecrc +++ b/workflow-templates/assets/check-general-formatting/.ecrc @@ -1,6 +1,6 @@ { "Exclude": [ - "LICENSE.txt", - "poetry.lock" + "^LICENSE\\.txt$", + "^poetry\\.lock$" ] }