Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ci: Update Superlinter to run fixes #1318

Open
wants to merge 9 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
64 changes: 58 additions & 6 deletions .github/workflows/linter.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -10,24 +10,22 @@ name: Lint Code Base
# https://docs.github.com/en/actions/learn-github-actions/workflow-syntax-for-github-actions
#

#############################
# Start the job on all push #
#############################
on:
push:
branches-ignore: [main]
# Remove the line above to run when pushing to main
pull_request:
branches: [main]

permissions:
contents: read

###############
# Set the Job #
###############
jobs:
build:
# Name the Job
lint:
name: Lint Code Base
# Set the agent to run on
runs-on: ubuntu-latest

##################
Expand Down Expand Up @@ -60,3 +58,57 @@ jobs:
VALIDATE_CHECKOV: false
VALIDATE_JAVASCRIPT_STANDARD: false
VALIDATE_TYPESCRIPT_STANDARD: false

fix-lint-issues:
name: Fix Lint Issues
permissions:
contents: write
statuses: write
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
token: ${{ secrets.LINTER_ACCESS_TOKEN }}

- name: Super-Linter
uses: super-linter/super-linter/slim@v7
env:
DEFAULT_BRANCH: main
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
FILTER_REGEX_EXCLUDE: 'gemini/sample-apps/finance-advisor-spanner/.*\.sql'
SHELLCHECK_OPTS: -e SC1091 -e 2086
VALIDATE_ALL_CODEBASE: false
VALIDATE_PYTHON_PYINK: false
VALIDATE_CHECKOV: false
VALIDATE_JAVASCRIPT_STANDARD: false
VALIDATE_TYPESCRIPT_STANDARD: false

FIX_CSS: true
FIX_GOOGLE_JAVA_FORMAT: true
FIX_JAVASCRIPT_ES: true
FIX_JAVASCRIPT_PRETTIER: true
FIX_MARKDOWN: true
FIX_PYTHON_BLACK: true
FIX_PYTHON_ISORT: true
FIX_PYTHON_RUFF: true
FIX_SHELL_SHFMT: true
FIX_TYPESCRIPT_ES: true
FIX_TYPESCRIPT_PRETTIER: true
FIX_YAML_PRETTIER: true
# To reuse the same Super-linter configuration that you use in the
# lint job without duplicating it, see
# https://github.com/super-linter/super-linter/blob/main/docs/run-linter-locally.md#share-environment-variables-between-environments
- name: Commit and push linting fixes
# Run only on:
# - Pull requests
# - Not on the default branch
if: >
github.event_name == 'pull_request' &&
github.ref_name != github.event.repository.default_branch
uses: stefanzweifel/git-auto-commit-action@v5
with:
branch: ${{ github.event.pull_request.head.ref || github.head_ref || github.ref }}
commit_message: "chore: fix linting issues"
commit_user_name: super-linter
commit_user_email: [email protected]
616 changes: 616 additions & 0 deletions report/html/index.html

Large diffs are not rendered by default.

16 changes: 16 additions & 0 deletions report/html/js/prism.js

Large diffs are not rendered by default.

Loading
Loading