generated from pyiron/pyiron_module_template
-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* add ruff linter/formatter to CI * show diff * enable common ruff rules * exclude some files from formatting * sort imports * apply ruff auto-fixes * apply unsafe fixes -- NEEDS REVIEW! * ignore line-length violations as they are covered by the formatter * reset _version and add it to excludes * fix logger reimport * fix over-eager optimizations in tests * format fixes * some custom fixes * deactivate F401 for main include * Get rid of creator and wrapper caches Signed-off-by: liamhuber <[email protected]> * De-abstract HasCreator * Remove unused import Signed-off-by: liamhuber <[email protected]> * Ignore unused imports in init files\n\nwe specify APIs this way * Remove ABC I personally like to use it as an indicator to devs that there's no intention of actually instantiating this class itself, but ruff insists that they are _only_ for specifying interfaces, and without and abstractmethod this doesn't make the cut. I acquiesce. Signed-off-by: liamhuber <[email protected]> * Don't use lru_cache The operation is simple enough that the savings must have been minimal, and this is not used repeatedly (only when parsing class definitions to start with, e.g. at initial import), so any minor cost is going to be tolerable anyhow. Signed-off-by: liamhuber <[email protected]> * Use a more descriptive variable Signed-off-by: liamhuber <[email protected]> * Use more descriptive variables Signed-off-by: liamhuber <[email protected]> * Use more specific settings field Per ruff deprecation warning Signed-off-by: liamhuber <[email protected]> * Keep the Workflow import separate It was placed intentionally separate from the other imports to distinguish the pyironic single-import user interface from the more standard user/dev public API imports. The line is annotated to prevent ruff from moving it back later. Signed-off-by: liamhuber <[email protected]> * Remove redundant per-file linter directions Signed-off-by: liamhuber <[email protected]> * Accept ruff format -- except for multiline strings\n\nI'm not ready to accept the drop in readability from ruff's formatting here. On a quick search, I didn't find any way to modify just this element of the formatting. * Remove ruff format Until I either cave on the multiline string formatting, or ruff let's us change it. In the meantime we use black anyhow for formatting. Signed-off-by: liamhuber <[email protected]> * Re-instert intentional bad formatting\n\nFor testing the parser * Adjust test expectation for reformatted test * Desingleton creator (#527) * De-singleton creator and wrapper and update docstring * Sneak a fix for 522 while we're here --------- Signed-off-by: liamhuber <[email protected]> Co-authored-by: liamhuber <[email protected]>
- Loading branch information
Showing
69 changed files
with
1,262 additions
and
1,395 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,17 @@ | ||
name: Ruff | ||
on: [ push, pull_request ] | ||
jobs: | ||
ruff-check: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v4 | ||
- uses: astral-sh/ruff-action@v1 | ||
with: | ||
args: check | ||
ruff-sort-imports: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v4 | ||
- uses: astral-sh/ruff-action@v1 | ||
with: | ||
args: check --select I --fix --diff |
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
Oops, something went wrong.