-
Notifications
You must be signed in to change notification settings - Fork 14
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Use MegaLinter for linting in workflows
- Loading branch information
1 parent
243df6b
commit 951dba9
Showing
4 changed files
with
61 additions
and
30 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,45 @@ | ||
--- | ||
# MegaLinter GitHub Action configuration file | ||
# More info at https://megalinter.io | ||
name: MegaLinter | ||
on: | ||
push: | ||
branches: "master" | ||
pull_request: | ||
|
||
jobs: | ||
megalinter: | ||
name: MegaLinter | ||
runs-on: ubuntu-latest | ||
permissions: | ||
# Give the linter write permission to comment on PRs (if PR is not from fork) | ||
issues: write | ||
pull-requests: write | ||
steps: | ||
# Git Checkout | ||
- name: Checkout Code | ||
uses: actions/checkout@v4 | ||
with: | ||
token: ${{ secrets.GITHUB_TOKEN }} | ||
fetch-depth: 0 | ||
# MegaLinter | ||
- name: MegaLinter | ||
id: ml | ||
# You can override MegaLinter flavor used to have faster performances | ||
# More info at https://megalinter.io/flavors/ | ||
uses: oxsecurity/megalinter/flavors/python@v7 | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
# Validate whole codebase on pushes and only changes on pull requests | ||
# VALIDATE_ALL_CODEBASE: ${{ github.event_name == 'push'}} | ||
VALIDATE_ALL_CODEBASE: true | ||
|
||
# Upload MegaLinter artifacts | ||
- name: Archive production artifacts | ||
if: success() || failure() | ||
uses: actions/upload-artifact@v4 | ||
with: | ||
name: MegaLinter reports | ||
path: | | ||
megalinter-reports | ||
mega-linter.log |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
# All available variables are described in documentation | ||
# https://megalinter.io/configuration/ | ||
|
||
LINTER_RULES_PATH: . | ||
|
||
ENABLE_LINTERS: | ||
- PYTHON_BLACK | ||
- PYTHON_FLAKE8 | ||
|
||
# Make workflow fail even on non blocking errors | ||
FORMATTERS_DISABLE_ERRORS: false | ||
|
||
PYTHON_BLACK_CONFIG_FILE: pyproject.toml | ||
PYTHON_FLAKE8_CONFIG_FILE: tox.ini |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters