-
Notifications
You must be signed in to change notification settings - Fork 102
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #1186 from dimaqq/chore-ruff
#1186 What this PR does In short, we'll be relying on ruff via pre-commit as opposed to flake8 via tox. - switches from flake8 to ruff - reformats the source code - reformats the docstrings where safe, conservatively - resolves ruff complaints where that's straightforward - silences with a `FIXME` where public API could break or code change is not obvious or where too much manual work is required, those can be fixed in separate PRs - updates the CI and docs for the above Check list - [x] pre-commit config - [x] ruff over the codebase - [x] resolve or silence errors - [x] kill old linter and github actions - [x] GitHub actions to check pre-commit - [x] run pre-commit after codegen - [x] add to docs
- Loading branch information
Showing
205 changed files
with
41,601 additions
and
27,850 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
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 |
---|---|---|
@@ -0,0 +1,17 @@ | ||
--- | ||
name: pre-commit | ||
|
||
on: | ||
pull_request: | ||
push: | ||
branches: [main] | ||
|
||
jobs: | ||
pre-commit: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v4 | ||
- uses: actions/setup-python@v5 | ||
with: | ||
python-version: "3.13" | ||
- uses: pre-commit/action@v3.0.1 |
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 |
---|---|---|
|
@@ -15,4 +15,3 @@ jobs: | |
steps: | ||
- uses: actions/checkout@v4 | ||
- uses: wagoid/commitlint-github-action@v6 | ||
|
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 |
---|---|---|
@@ -0,0 +1,46 @@ | ||
repos: | ||
- repo: https://github.com/pre-commit/pre-commit-hooks | ||
rev: v4.5.0 | ||
hooks: | ||
- id: check-added-large-files | ||
exclude: | | ||
(?x) # Verbose mode | ||
^juju/client/schemas-juju-.*[.]json$ | | ||
^tests/.*[.]charm$ | | ||
^examples/.*[.]charm$ | ||
- id: check-ast | ||
- id: check-case-conflict | ||
- id: check-executables-have-shebangs | ||
- id: check-shebang-scripts-are-executable | ||
- id: check-merge-conflict | ||
- id: check-symlinks | ||
- id: check-json | ||
- id: check-yaml | ||
# Overlays deliberately comprise multiple YAML documents per file | ||
exclude: "^tests/integration/bundle/test-overlays/.*multi.*yaml$" | ||
- id: check-toml | ||
- id: mixed-line-ending | ||
- id: end-of-file-fixer | ||
exclude: "^juju/client/schemas-juju-.*[.]json$" | ||
- id: trailing-whitespace | ||
- id: detect-private-key | ||
exclude: "^tests/.*$" | ||
|
||
- repo: https://github.com/astral-sh/ruff-pre-commit | ||
rev: v0.7.3 | ||
hooks: | ||
- id: ruff | ||
args: [ --preview, --fix ] | ||
- id: ruff-format | ||
args: [ --preview ] | ||
|
||
- repo: https://github.com/codespell-project/codespell | ||
rev: v2.3.0 | ||
hooks: | ||
- id: codespell | ||
additional_dependencies: | ||
- tomli | ||
exclude: "^juju/client/schemas-juju-.*[.]json$" | ||
|
||
ci: | ||
autofix_prs: false |
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 |
---|---|---|
|
@@ -10,4 +10,4 @@ build: | |
python: "3.10" | ||
|
||
sphinx: | ||
configuration: docs/conf.py | ||
configuration: docs/conf.py |
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
Oops, something went wrong.