From a90653122ecbc7a37541077aa21c2f2d4566e25a Mon Sep 17 00:00:00 2001 From: Vianpyro Date: Mon, 12 May 2025 22:46:06 +0000 Subject: [PATCH 1/6] Refactor VSCode configuration: update postAttachCommand and streamline task settings --- .devcontainer/devcontainer.json | 6 +++--- .vscode/settings.json | 11 ++++------- .vscode/tasks.json | 18 ++++++++++++++++++ 3 files changed, 25 insertions(+), 10 deletions(-) create mode 100644 .vscode/tasks.json diff --git a/.devcontainer/devcontainer.json b/.devcontainer/devcontainer.json index b40f31c..67bebb0 100644 --- a/.devcontainer/devcontainer.json +++ b/.devcontainer/devcontainer.json @@ -7,12 +7,12 @@ }, "vscode": { "extensions": [ - "mtxr.sqltools-driver-mysql", "dorzey.vscode-sqlfluff", - "emeraldwalk.RunOnSave" + "gruntfuggly.triggertaskonsave", + "mtxr.sqltools-driver-mysql" ] } }, - "postStartCommand": "sqlfluff fix", + "postAttachCommand": "sqlfluff fix -v", "remoteUser": "vscode" } diff --git a/.vscode/settings.json b/.vscode/settings.json index 822d160..fdc80a3 100644 --- a/.vscode/settings.json +++ b/.vscode/settings.json @@ -8,12 +8,9 @@ "files.insertFinalNewline": true, "files.trimFinalNewlines": true, "files.trimTrailingWhitespace": true, - "emeraldwalk.runonsave": { - "commands": [ - { - "match": "*.sql", - "cmd": "sqlfluff fix '${fileBasename}'" - } + "triggerTaskOnSave.tasks": { + "Lint SQL File": [ + "**/*.sql" ] - } + }, } diff --git a/.vscode/tasks.json b/.vscode/tasks.json new file mode 100644 index 0000000..6af7386 --- /dev/null +++ b/.vscode/tasks.json @@ -0,0 +1,18 @@ +{ + "version": "2.0.0", + "tasks": [ + { + "label": "Lint SQL File", + "type": "shell", + "command": "sqlfluff fix '${fileBasename}' -v", + "group": { + "kind": "none", + "isDefault": true + }, + "problemMatcher": [], + "runOptions": { + "runOn": "default" + }, + } + ] +} From 40d2697201e1a3bca6fce43dbb10add2c8a7a549 Mon Sep 17 00:00:00 2001 From: Vianpyro Date: Mon, 9 Jun 2025 11:11:41 +0000 Subject: [PATCH 2/6] Update Super-Linter configuration and add Prettier settings --- .github/workflows/super-linter.yml | 39 +++++++++++++++++++++++++++--- prettierrc.txt | 16 ++++++++++++ 2 files changed, 52 insertions(+), 3 deletions(-) create mode 100644 prettierrc.txt diff --git a/.github/workflows/super-linter.yml b/.github/workflows/super-linter.yml index 91b756b..a10cb99 100644 --- a/.github/workflows/super-linter.yml +++ b/.github/workflows/super-linter.yml @@ -26,10 +26,43 @@ jobs: fetch-depth: 0 - name: Super-linter - uses: super-linter/super-linter@v7 + uses: super-linter/super-linter/slim@v7 env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} VALIDATE_ALL_CODEBASE: false - VALIDATE_JSON_PRETTIER: false - SQLFLUFF_CONFIG_FILE: .sqlfluff FILTER_REGEX_EXCLUDE: "(.devcontainer/Dockerfile|.github/pull_request_template.md|.github/ISSUE_TEMPLATE/*.md)" + + fix-lint: + name: Fix Lint + runs-on: ubuntu-latest + + steps: + - name: Checkout code + uses: actions/checkout@v4 + with: + fetch-depth: 0 + + - name: Super-linter + uses: super-linter/super-linter/slim@v7 + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + VALIDATE_ALL_CODEBASE: false + FILTER_REGEX_EXCLUDE: '(.github/pull_request_template.md|.github/ISSUE_TEMPLATE/*.md)' + FIX_JSON_PRETTIER: true + FIX_MARKDOWN: true + FIX_MARKDOWN_PRETTIER: true + FIX_SHELL_SHFMT: true + FIX_SQLFLUFF: true + FIX_YAML_PRETTIER: true + VALIDATE_DOCKERFILE_HADOLINT: false + + - name: Commit and push linting fixes + if: > + github.event_name == 'pull_request' && + github.event.pull_request.head.ref != github.event.repository.default_branch + uses: stefanzweifel/git-auto-commit-action@v5 + with: + branch: ${{ github.event.pull_request.head.ref }} + commit_message: 'chore: fix linting issues' + commit_user_name: super-linter + commit_user_email: super-linter@super-linter.dev diff --git a/prettierrc.txt b/prettierrc.txt new file mode 100644 index 0000000..a94092b --- /dev/null +++ b/prettierrc.txt @@ -0,0 +1,16 @@ +{ + "overrides": [ + { + "files": ["*.yml", "*.yaml", "*.md"], + "options": { + "tabWidth": 2 + } + } + ], + "printWidth": 80, + "semi": false, + "singleQuote": true, + "tabWidth": 4, + "trailingComma": "es5", + "useTabs": false +} From cfec80c9560977fd63b46111fe1c5ad396558082 Mon Sep 17 00:00:00 2001 From: Vianpyro Date: Mon, 9 Jun 2025 11:12:00 +0000 Subject: [PATCH 3/6] Migrate Prettier configuration from prettierrc.txt to .prettierrc --- prettierrc.txt => .prettierrc | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename prettierrc.txt => .prettierrc (100%) diff --git a/prettierrc.txt b/.prettierrc similarity index 100% rename from prettierrc.txt rename to .prettierrc From bf9f3035550cb27a280e21de883eff5ce4db1c12 Mon Sep 17 00:00:00 2001 From: Vianpyro Date: Mon, 9 Jun 2025 11:16:13 +0000 Subject: [PATCH 4/6] Fix formatting in Super-Linter and VSCode configuration files --- .github/workflows/super-linter.yml | 2 +- .vscode/settings.json | 10 +++------- .vscode/tasks.json | 2 +- 3 files changed, 5 insertions(+), 9 deletions(-) diff --git a/.github/workflows/super-linter.yml b/.github/workflows/super-linter.yml index a10cb99..d29eea9 100644 --- a/.github/workflows/super-linter.yml +++ b/.github/workflows/super-linter.yml @@ -30,7 +30,7 @@ jobs: env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} VALIDATE_ALL_CODEBASE: false - FILTER_REGEX_EXCLUDE: "(.devcontainer/Dockerfile|.github/pull_request_template.md|.github/ISSUE_TEMPLATE/*.md)" + FILTER_REGEX_EXCLUDE: '(.devcontainer/Dockerfile|.github/pull_request_template.md|.github/ISSUE_TEMPLATE/*.md)' fix-lint: name: Fix Lint diff --git a/.vscode/settings.json b/.vscode/settings.json index fdc80a3..f890e3e 100644 --- a/.vscode/settings.json +++ b/.vscode/settings.json @@ -1,7 +1,5 @@ { - "editor.rulers": [ - 100 - ], + "editor.rulers": [100], "editor.tabSize": 4, "editor.insertSpaces": true, "editor.formatOnSave": true, @@ -9,8 +7,6 @@ "files.trimFinalNewlines": true, "files.trimTrailingWhitespace": true, "triggerTaskOnSave.tasks": { - "Lint SQL File": [ - "**/*.sql" - ] - }, + "Lint SQL File": ["**/*.sql"] + } } diff --git a/.vscode/tasks.json b/.vscode/tasks.json index 6af7386..7ba7e53 100644 --- a/.vscode/tasks.json +++ b/.vscode/tasks.json @@ -12,7 +12,7 @@ "problemMatcher": [], "runOptions": { "runOn": "default" - }, + } } ] } From 9c0f7882f57a8a94fce199146ed8c0589d2a331b Mon Sep 17 00:00:00 2001 From: Vianpyro Date: Mon, 9 Jun 2025 11:19:36 +0000 Subject: [PATCH 5/6] Update permissions in Super-Linter workflow to enable write access for contents and statuses --- .github/workflows/super-linter.yml | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/.github/workflows/super-linter.yml b/.github/workflows/super-linter.yml index d29eea9..f9fdaa6 100644 --- a/.github/workflows/super-linter.yml +++ b/.github/workflows/super-linter.yml @@ -7,7 +7,9 @@ on: - main pull_request: null -permissions: {} +permissions: + contents: write + statuses: write jobs: build: From d737c24195c3548b60e630d0dc9260b277f3ba65 Mon Sep 17 00:00:00 2001 From: Vianpyro <10519369+Vianpyro@users.noreply.github.com> Date: Mon, 9 Jun 2025 11:21:24 +0000 Subject: [PATCH 6/6] chore: fix linting issues --- github_conf/branch_protection_rules.json | 5 +++++ super-linter-output/super-linter-summary.md | 15 +++++++++++++++ 2 files changed, 20 insertions(+) create mode 100644 github_conf/branch_protection_rules.json create mode 100644 super-linter-output/super-linter-summary.md diff --git a/github_conf/branch_protection_rules.json b/github_conf/branch_protection_rules.json new file mode 100644 index 0000000..e545d76 --- /dev/null +++ b/github_conf/branch_protection_rules.json @@ -0,0 +1,5 @@ +{ + "message": "Not Found", + "documentation_url": "https://docs.github.com/rest", + "status": "404" +} \ No newline at end of file diff --git a/super-linter-output/super-linter-summary.md b/super-linter-output/super-linter-summary.md new file mode 100644 index 0000000..f6ba74d --- /dev/null +++ b/super-linter-output/super-linter-summary.md @@ -0,0 +1,15 @@ +# Super-linter summary + +| Language | Validation result | +| -------------------------- | ----------------- | +| CHECKOV | Pass ✅ | +| GITHUB_ACTIONS | Pass ✅ | +| GITLEAKS | Pass ✅ | +| GIT_MERGE_CONFLICT_MARKERS | Pass ✅ | +| JSCPD | Pass ✅ | +| JSON | Pass ✅ | +| JSON_PRETTIER | Pass ✅ | +| YAML | Pass ✅ | +| YAML_PRETTIER | Pass ✅ | + +All files and directories linted successfully