From 35634af17ec7c484b2564b89c1f98450346a2418 Mon Sep 17 00:00:00 2001 From: Ismo Vuorinen Date: Fri, 28 Nov 2025 16:49:12 +0200 Subject: [PATCH] chore: linting updates, fixes (#85) * chore: linting fixes * chore(deps): update github workflows * fix(ci): pr-lint permissions * fix(ci): add missing UID * fix(ci): pr-lint permissions * fix(ci): cr tweak --- .editorconfig | 1 - .github/ISSUE_TEMPLATE/bug_report.md | 17 ++++++++++------- .github/renovate.json | 8 ++++---- .github/workflows/codeql.yml | 10 +++++----- .github/workflows/pr-lint.yml | 17 +++++++++++++++-- .pre-commit-config.yaml | 26 +++++++------------------- completions/phpenv.fish | 1 - conf.d/phpenv.fish | 1 - fish_plugins | 1 - functions/phpenv.fish | 1 - 10 files changed, 41 insertions(+), 42 deletions(-) diff --git a/.editorconfig b/.editorconfig index 9cf0d48..b75c908 100644 --- a/.editorconfig +++ b/.editorconfig @@ -14,4 +14,3 @@ max_line_length = 120 # Markdown files [*.md] max_line_length = 200 - diff --git a/.github/ISSUE_TEMPLATE/bug_report.md b/.github/ISSUE_TEMPLATE/bug_report.md index f57b5f9..d2190be 100644 --- a/.github/ISSUE_TEMPLATE/bug_report.md +++ b/.github/ISSUE_TEMPLATE/bug_report.md @@ -12,6 +12,7 @@ A clear and concise description of what the bug is. **To Reproduce** Steps to reproduce the behavior: + 1. Go to '...' 2. Click on '....' 3. Scroll down to '....' @@ -24,15 +25,17 @@ A clear and concise description of what you expected to happen. If applicable, add screenshots to help explain your problem. **Desktop (please complete the following information):** - - OS: [e.g. iOS] - - Browser [e.g. chrome, safari] - - Version [e.g. 22] + +- OS: [e.g. iOS] +- Browser [e.g. chrome, safari] +- Version [e.g. 22] **Smartphone (please complete the following information):** - - Device: [e.g. iPhone6] - - OS: [e.g. iOS8.1] - - Browser [e.g. stock browser, safari] - - Version [e.g. 22] + +- Device: [e.g. iPhone6] +- OS: [e.g. iOS8.1] +- Browser [e.g. stock browser, safari] +- Version [e.g. 22] **Additional context** Add any other context about the problem here. diff --git a/.github/renovate.json b/.github/renovate.json index e46316f..f02f654 100644 --- a/.github/renovate.json +++ b/.github/renovate.json @@ -1,6 +1,6 @@ { - "$schema": "https://docs.renovatebot.com/renovate-schema.json", - "extends": [ - "github>ivuorinen/renovate-config" - ] + "$schema": "https://docs.renovatebot.com/renovate-schema.json", + "extends": [ + "github>ivuorinen/renovate-config" + ] } diff --git a/.github/workflows/codeql.yml b/.github/workflows/codeql.yml index fe56ed3..6802243 100644 --- a/.github/workflows/codeql.yml +++ b/.github/workflows/codeql.yml @@ -1,14 +1,14 @@ --- # yaml-language-server: $schema=https://json.schemastore.org/github-workflow.json -name: 'CodeQL' +name: "CodeQL" on: push: - branches: ['main'] + branches: ["main"] pull_request: - branches: ['main'] + branches: ["main"] schedule: - - cron: '30 1 * * 0' # Run at 1:30 AM UTC every Sunday + - cron: "30 1 * * 0" # Run at 1:30 AM UTC every Sunday merge_group: permissions: @@ -43,4 +43,4 @@ jobs: - name: Perform CodeQL Analysis uses: github/codeql-action/analyze@fdbfb4d2750291e159f0156def62b853c2798ca2 # v4.31.5 with: - category: '/language:${{matrix.language}}' + category: "/language:${{matrix.language}}" diff --git a/.github/workflows/pr-lint.yml b/.github/workflows/pr-lint.yml index d97a1e2..0d49416 100644 --- a/.github/workflows/pr-lint.yml +++ b/.github/workflows/pr-lint.yml @@ -20,11 +20,24 @@ jobs: runs-on: ubuntu-latest timeout-minutes: 15 permissions: - statuses: write - contents: read + contents: write + issues: write packages: read + pull-requests: write + statuses: write steps: + - name: Checkout repository + uses: actions/checkout@v4 + with: + fetch-depth: 0 + token: ${{ secrets.GITHUB_TOKEN }} + persist-credentials: true + - name: Run PR Lint # https://github.com/ivuorinen/actions uses: ivuorinen/actions/pr-lint@e58465e5d305c3dcdd6e3b788e2b683dc706ea9e # v25.11.25 + with: + username: 'github-actions' + email: 'github-actions@github.com' + token: ${{ secrets.GITHUB_TOKEN }} diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 590e09b..76cc800 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -4,26 +4,20 @@ repos: rev: v6.0.0 hooks: - id: check-added-large-files - - id: check-ast - - id: check-builtin-literals - id: check-case-conflict - id: check-executables-have-shebangs - id: check-json - id: check-merge-conflict - id: check-shebang-scripts-are-executable - id: check-symlinks - - id: check-toml - - id: check-xml - id: check-yaml args: [--allow-multiple-documents] - - id: debug-statements - id: detect-private-key - id: end-of-file-fixer - id: mixed-line-ending args: [--fix=auto] - id: pretty-format-json args: [--autofix, --no-sort-keys] - - id: requirements-txt-fixer - id: trailing-whitespace args: [--markdown-linebreak-ext=md] @@ -32,7 +26,7 @@ repos: rev: v1.5.0 hooks: - id: detect-secrets - args: ['--baseline', '.secrets.baseline'] + args: ["--baseline", ".secrets.baseline"] - repo: https://github.com/gitleaks/gitleaks rev: v8.30.0 @@ -64,27 +58,21 @@ repos: rev: v3.12.0-2 hooks: - id: shfmt - args: [-w, -s, -i, '2'] + args: [-w, -s, -i, "2"] # Shell linting - repo: https://github.com/koalaman/shellcheck-precommit rev: v0.11.0 hooks: - id: shellcheck - args: ['--severity=warning'] + args: ["--severity=warning"] # GitHub Actions linting - repo: https://github.com/rhysd/actionlint rev: v1.7.9 hooks: - id: actionlint - args: ['-shellcheck='] - - # Renovate config validation - - repo: https://github.com/renovatebot/pre-commit-hooks - rev: 42.21.3 - hooks: - - id: renovate-config-validator + args: ["-shellcheck="] # Security scanning - repo: https://github.com/bridgecrewio/checkov.git @@ -92,6 +80,6 @@ repos: hooks: - id: checkov args: - - '--quiet' - - '--framework' - - 'github_actions,yaml' + - "--quiet" + - "--framework" + - "github_actions,yaml" diff --git a/completions/phpenv.fish b/completions/phpenv.fish index 8b627e8..1323660 100644 --- a/completions/phpenv.fish +++ b/completions/phpenv.fish @@ -120,4 +120,3 @@ complete -c phpenv -f \ # Complete help options complete -c phpenv -f -s h -l help -d "Show help" - diff --git a/conf.d/phpenv.fish b/conf.d/phpenv.fish index 1b93ca9..0ca1859 100644 --- a/conf.d/phpenv.fish +++ b/conf.d/phpenv.fish @@ -35,4 +35,3 @@ if test -n "$PHPENV_GLOBAL_VERSION"; and not set -q PHPENV_INITIALIZED end set -g PHPENV_INITIALIZED true end - diff --git a/fish_plugins b/fish_plugins index 8d03752..719a817 100644 --- a/fish_plugins +++ b/fish_plugins @@ -82,4 +82,3 @@ function __phpenv_uninstall --on-event phpenv_uninstall echo "phpenv.fish configuration removed." echo "Note: Installed PHP versions are preserved." end - diff --git a/functions/phpenv.fish b/functions/phpenv.fish index faa3285..8c165a1 100644 --- a/functions/phpenv.fish +++ b/functions/phpenv.fish @@ -1096,4 +1096,3 @@ function __phpenv_validate_extensions -a phpenv_extensions_string return 1 end end -