-
Notifications
You must be signed in to change notification settings - Fork 28
MNT: upgrade ruff pre-commit hook, move its configuration out of pre-commit-config.yaml and fix lints #371
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from 3 commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,16 +1,17 @@ | ||
| import argparse | ||
| import json | ||
| import os | ||
| import re | ||
| import shutil | ||
| import subprocess | ||
| import sys | ||
| import re | ||
| import json | ||
|
|
||
| import numpy as np | ||
| import matplotlib.pyplot as plt | ||
| import numpy as np | ||
|
|
||
| from .dump_io import readDump | ||
|
|
||
|
|
||
| class bcolors: | ||
| HEADER = '\033[95m' | ||
| OKBLUE = '\033[94m' | ||
|
|
@@ -166,8 +167,10 @@ def addLog(self, entry): | |
| with open(os.path.join(self.problemDir,"testsuite.log.json"), "w+") as fp: | ||
| json.dump(self.log, fp, indent='\t') | ||
|
|
||
| def applyConfig(self, config: dict={}): | ||
| def applyConfig(self, config: dict | None = None): | ||
| # check args | ||
| if config is None: | ||
| config = {} | ||
| for key, value in config.items(): | ||
| if key not in ['ini', 'testfile', 'testname', 'dumpname', 'check_file_produced']: | ||
| assert key in self.cmdArgs, f"The given configuration overriding try to set an invalid paramater : {key}={value}" | ||
|
|
@@ -253,7 +256,9 @@ def _genCmakeCommand(self,definitionFile=""): | |
| return comm | ||
|
|
||
|
|
||
| def configure(self,definitionFile="", reuse_last_same_build=True, override: dict={}): | ||
| def configure(self,definitionFile="", reuse_last_same_build=True, override: dict | None = None): | ||
| if override is None: | ||
| override = {} | ||
|
Comment on lines
+260
to
+261
Collaborator
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Indentation inconsistencies can trivially be resolved in the long run by also enabling the formatter hook from ruff. Happy to open a follow up PR to achieve this.
Collaborator
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. #392 👀 |
||
| # log | ||
| self.addLog({"call": "configure", "args":{ | ||
| 'definitionFile': definitionFile, | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,14 @@ | ||
| target-version = "py310" | ||
|
glesur marked this conversation as resolved.
|
||
|
|
||
| [lint] | ||
| select = [ | ||
| "F", # pyflakes | ||
| "B", # flake8-bugbear | ||
| "I", # isort | ||
| "NPY", # numpy-specific rules | ||
| ] | ||
| ignore = [ | ||
| # allow `import *` | ||
| "F403", # undefined-local-with-import-star | ||
| "F405", # undefined-local-with-import-star-usage | ||
| ] | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -2,6 +2,7 @@ | |
|
|
||
| import os | ||
| import sys | ||
|
|
||
| import pytest | ||
|
|
||
| # set IDEFIX_DIR | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -6,6 +6,7 @@ | |
| """ | ||
| import os | ||
| import sys | ||
|
|
||
| sys.path.append(os.getenv("IDEFIX_DIR")) | ||
|
|
||
| import pytools.idfx_test as tst | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -6,6 +6,7 @@ | |
| """ | ||
| import os | ||
| import sys | ||
|
|
||
| sys.path.append(os.getenv("IDEFIX_DIR")) | ||
|
|
||
| import pytools.idfx_test as tst | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -6,6 +6,7 @@ | |
| """ | ||
| import os | ||
| import sys | ||
|
|
||
| sys.path.append(os.getenv("IDEFIX_DIR")) | ||
|
|
||
| import pytools.idfx_test as tst | ||
|
|
||
Uh oh!
There was an error while loading. Please reload this page.