-
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.
Deduplicate Linter Workflows and make it smoother (#71)
* giving the linter a name * trying to make the check a requirement * actually write the copyright * dedup linter * specify to run on all prs to main * test linter * more testing * Fix code style issues with Autopep8 * Fix code style issues with clang_format * fix auto-linter locking up ci * Fix code style issues with clang_format * testing * testing with different token * Fix code style issues with clang_format * adding auto-lint remove label script * capitalization * final test * whoops * rename * switch around ordering * maybe now? * Fix code style issues with Autopep8 * Fix code style issues with clang_format --------- Co-authored-by: WATonomousAdmin <[email protected]>
- Loading branch information
1 parent
5bcae75
commit 74f3b17
Showing
4 changed files
with
29 additions
and
47 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 |
---|---|---|
@@ -1,9 +1,15 @@ | ||
name: Monorepo Code Linting - Auto Linter | ||
|
||
on: | ||
push: | ||
branches: | ||
- main | ||
pull_request: | ||
branches: | ||
- main | ||
types: | ||
- labeled | ||
- synchronize | ||
|
||
jobs: | ||
run-linters: | ||
|
@@ -13,6 +19,8 @@ jobs: | |
steps: | ||
- name: Check out Git repository | ||
uses: actions/checkout@v4 | ||
with: | ||
token: ${{ secrets.GHCR_PWD }} | ||
|
||
- name: Set up Python | ||
uses: actions/setup-python@v1 | ||
|
@@ -23,13 +31,24 @@ jobs: | |
run: pip install autopep8 clang-format | ||
|
||
- name: Run linters, make changes | ||
continue-on-error: true | ||
uses: WATonomous/wato-lint-action@v1 | ||
with: | ||
git_name: WATonomousAdmin | ||
git_email: [email protected] | ||
auto_fix: ${{ contains(github.event.pull_request.labels.*.name, 'auto-lint') }} | ||
Autopep8: true | ||
Autopep8_args: "--max-line-length 100" | ||
clang_format: true | ||
clang_format_auto_fix: ${{ contains(github.event.pull_request.labels.*.name, 'auto-lint') }} | ||
clang_format_args: "-style=file" | ||
|
||
- name: Remove 'auto-lint' label to stop possible inf loop | ||
if: contains(github.event.pull_request.labels.*.name, 'auto-lint') | ||
uses: actions/github-script@v6 | ||
with: | ||
script: | | ||
await github.rest.issues.removeLabel({ | ||
owner: context.repo.owner, | ||
repo: context.repo.repo, | ||
issue_number: context.issue.number, | ||
name: 'auto-lint' | ||
}); |
This file was deleted.
Oops, something went wrong.
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