-
Notifications
You must be signed in to change notification settings - Fork 301
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
DAOS-14559 ci: Create Actions jobs for isort linting and version chec…
…king. (#13258) Create a new generic linting job and add isort checking. Pin versions of python checking tools. Add job to master that checks versions are up-to-date. Fix isort options for line-length and blacklisting. Resolve isort and codespell issues. Overall this increases coverage with new checks, gives us a common linting job which should be easier to manage that multiple ones and allows us to run PRs with pinned versions to prevent upstream changes blocking development but still fails master checking when updates are available. Signed-off-by: Ashley Pittman <[email protected]>
- Loading branch information
1 parent
554d370
commit a4f2de1
Showing
44 changed files
with
158 additions
and
127 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,42 @@ | ||
name: Linting | ||
|
||
# Always run on Pull Requests as then these checks can be marked as required. | ||
on: | ||
push: | ||
branches: | ||
- master | ||
- 'feature/*' | ||
- 'release/*' | ||
pull_request: | ||
|
||
jobs: | ||
# Run isort on the tree. | ||
# This checks .py files only so misses SConstruct and SConscript files are not checked, rather | ||
# for these files check them afterwards. The output-filter will not be installed for this part | ||
# so regressions will be detected but not annotated. | ||
isort: | ||
name: Python isort | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v4 | ||
with: | ||
ref: ${{ github.event.pull_request.head.sha }} | ||
- uses: actions/setup-python@v3 | ||
- uses: isort/isort-action@master | ||
with: | ||
requirementsFiles: "requirements.txt utils/cq/requirements.txt" | ||
- name: Run on SConstruct file. | ||
run: isort --check-only SConstruct | ||
- name: Run on build files. | ||
run: find . -name SConscript | xargs isort --check-only | ||
|
||
log-check: | ||
name: Logging macro checking | ||
runs-on: ubuntu-22.04 | ||
steps: | ||
- name: Checkout code | ||
uses: actions/checkout@v4 | ||
with: | ||
ref: ${{ github.event.pull_request.head.sha }} | ||
- name: Check DAOS logging macro use. | ||
run: ./utils/cq/d_logging_check.py --github src |
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,26 @@ | ||
name: Version checking | ||
|
||
on: | ||
push: | ||
branches: | ||
- master | ||
|
||
jobs: | ||
upgrade-check: | ||
name: Check for updates | ||
runs-on: ubuntu-22.04 | ||
strategy: | ||
fail-fast: false | ||
matrix: | ||
package: [pylint, yamllint, isort, codespell] | ||
steps: | ||
- name: Checkout code | ||
uses: actions/checkout@v3 | ||
- name: Install extra python packages | ||
run: python3 -m pip install --requirement utils/cq/requirements.txt | ||
- name: Check ${{ matrix.package }} version | ||
run: python -m ${{ matrix.package }} --version | tee -a version-pre | ||
- name: Upgrade | ||
run: pip install --upgrade ${{ matrix.package }} | ||
- name: Check ${{ matrix.package }} for version | ||
run: python -m ${{ matrix.package }} --version | diff version-pre - |
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
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,3 +1,5 @@ | ||
[tool.isort] | ||
supported_extensions = ["py"] | ||
skip = [".git/", "src/rdb/raft", "build", "install"] | ||
skip = [".git/", "src/rdb/raft", "build", "install", "venv", "src/control/vendor/"] | ||
line_length = 99 | ||
skip_gitignore = true |
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
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
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
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
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
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
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
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
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,5 +1,4 @@ | ||
"""apricot __init__.""" | ||
__all__ = ['Test', 'TestWithServers', 'TestWithoutServers', 'skipForTicket'] | ||
|
||
from apricot.test import (Test, TestWithoutServers, TestWithServers, | ||
skipForTicket) | ||
from apricot.test import Test, TestWithoutServers, TestWithServers, skipForTicket |
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
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
Oops, something went wrong.