-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
ci: upgrade linter system to use Bugalint
- Loading branch information
Showing
7 changed files
with
199 additions
and
0 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,16 @@ | ||
--- | ||
version: 2 | ||
updates: | ||
- package-ecosystem: github-actions | ||
directory: / | ||
labels: | ||
- dependabot | ||
- actions | ||
schedule: | ||
interval: daily | ||
groups: | ||
action-dependencies: | ||
patterns: | ||
- '*' | ||
commit-message: | ||
prefix: 'build' |
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,54 @@ | ||
--- | ||
name: Checks | ||
on: | ||
pull_request: | ||
paths: | ||
- '**.py*' | ||
- '.github/workflows/check-code.yml' | ||
jobs: | ||
lint: | ||
strategy: | ||
fail-fast: false | ||
matrix: | ||
linter: [ | ||
{'name': 'flake8', 'format': 'flake8', 'cwd': '.', 'cmd': 'flake8 .'}, | ||
{'name': 'mypy', 'format': 'mypy', 'cwd': '.', 'cmd': 'mypy .'}, | ||
{'name': 'pylint', 'format': 'pylint', 'cwd': '.', 'cmd': 'pylint --load-plugins pylint_pytest $(Get-ChildItem -Filter *.py -Recurse .)'}, | ||
] | ||
name: ${{ matrix.linter.name }} | ||
runs-on: windows-latest | ||
steps: | ||
- uses: actions/checkout@v3 | ||
Check failure Code scanning / yamllint wrong indentation: expected 6 but found 4 Error
wrong indentation: expected 6 but found 4
|
||
- uses: actions/setup-python@v4 | ||
with: | ||
python-version: '3.11' | ||
- name: Install Python dependencies | ||
run: py -m pip install -r dev-requirements.txt | ||
- name: Lint | ||
run: cd ${{ matrix.linter.cwd }}; ${{ matrix.linter.cmd }} > lint.log | ||
- name: Convert | ||
uses: bugale/bugalint@v2 | ||
if: always() | ||
with: | ||
inputFile: 'lint.log' | ||
toolName: ${{ matrix.linter.name }} | ||
inputFormat: ${{ matrix.linter.format }} | ||
- name: Upload results | ||
uses: github/codeql-action/upload-sarif@v3 | ||
if: always() | ||
with: | ||
sarif_file: sarif.json | ||
test: | ||
runs-on: windows-latest | ||
steps: | ||
- uses: actions/checkout@v3 | ||
Check failure Code scanning / yamllint wrong indentation: expected 6 but found 4 Error
wrong indentation: expected 6 but found 4
|
||
- uses: actions/setup-python@v4 | ||
with: | ||
python-version: '3.11' | ||
- uses: FedericoCarboni/setup-ffmpeg@v2 | ||
id: setup-ffmpeg | ||
- name: Install test dependencies | ||
run: py -m pip install -r dev-requirements.txt | ||
- name: Test | ||
run: pytest tests | ||
|
||
Check failure Code scanning / yamllint no new line character at the end of file Error
no new line character at the end of file
Check failure Code scanning / yamllint trailing spaces Error
trailing spaces
|
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,33 @@ | ||
--- | ||
name: Checks | ||
on: | ||
pull_request: | ||
paths: | ||
- '**.md' | ||
- '**mdl*' | ||
- '.github/workflows/check-docs.yml' | ||
jobs: | ||
markdownlint: | ||
name: markdownlint | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v4 | ||
- name: Lint | ||
uses: avto-dev/markdown-lint@v1 | ||
with: | ||
args: '**/*.md' | ||
output: 'lint.txt' | ||
config: '.mdl.yml' | ||
- name: Convert | ||
uses: ./ | ||
if: always() | ||
with: | ||
inputFile: 'lint.txt' | ||
toolName: 'mdl' | ||
inputFormat: 'mdl' | ||
- name: Upload results | ||
uses: github/codeql-action/upload-sarif@v3 | ||
if: always() | ||
with: | ||
sarif_file: sarif.json |
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,41 @@ | ||
--- | ||
name: Checks | ||
on: | ||
- pull_request | ||
jobs: | ||
required: | ||
name: Required Checks | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v4 | ||
- uses: ./ | ||
with: | ||
checks: |- | ||
Check .* | ||
.*[lL]int.* | ||
self: Required Checks | ||
check-commits: | ||
name: Check Commits | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Install Dependencies | ||
run: npm install -g @commitlint/cli @commitlint/config-conventional conventional-changelog-conventionalcommits | ||
- name: Get Base | ||
id: get-base | ||
run: |- | ||
count=$(gh api "/repos/${{ github.repository }}/pulls/${{ github.event.number }}/commits" --jq "length") | ||
req=$(($count + 1)) | ||
echo "count: $count, req: $req" | ||
echo "commit-count=$count" >> $GITHUB_OUTPUT | ||
echo "required=$req" >> $GITHUB_OUTPUT | ||
env: | ||
GH_TOKEN: ${{ github.token }} | ||
- name: Checkout | ||
uses: actions/checkout@v4 | ||
with: | ||
fetch-depth: ${{ steps.get-base.outputs.required }} | ||
ref: ${{ github.event.pull_request.head.sha }} | ||
- name: Check Commits | ||
run: |- | ||
commitlint --from ${{ github.event.pull_request.head.sha }}~${{ steps.get-base.outputs.commit-count }} --to ${{ github.event.pull_request.head.sha }} |
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,27 @@ | ||
--- | ||
name: Checks | ||
on: | ||
pull_request: | ||
paths: | ||
- '**.yml' | ||
jobs: | ||
yamllint: | ||
name: yamllint | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v4 | ||
- name: yamllint | ||
run: yamllint --strict -f parsable . > lint.txt | ||
- name: Convert | ||
uses: bugale/bugalint@v2 | ||
if: always() | ||
with: | ||
inputFile: 'lint.txt' | ||
toolName: 'yamllint' | ||
inputFormat: 'yamllint' | ||
- name: Upload results | ||
uses: github/codeql-action/upload-sarif@v3 | ||
if: always() | ||
with: | ||
sarif_file: sarif.json |
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,18 @@ | ||
--- | ||
name: Dependabot | ||
on: | ||
- pull_request | ||
permissions: write-all | ||
jobs: | ||
auto-merge: | ||
name: Auto-merge | ||
runs-on: ubuntu-latest | ||
if: ${{ github.actor == 'dependabot[bot]' }} | ||
steps: | ||
- name: Dependabot metadata | ||
id: metadata | ||
uses: dependabot/fetch-metadata@v1 | ||
- name: Enable auto-merge for Dependabot PRs | ||
run: gh pr merge --auto --rebase "${{github.event.pull_request.html_url}}" | ||
env: | ||
GH_TOKEN: ${{ github.token }} |
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,10 @@ | ||
--- | ||
extends: default | ||
ignore: | ||
- 'node_modules/**' | ||
rules: | ||
new-lines: disable | ||
truthy: | ||
check-keys: false | ||
line-length: | ||
max: 160 |