diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 0e4a84d..9573476 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -11,7 +11,7 @@ ci: submodules: false repos: - repo: https://github.com/pre-commit/pre-commit-hooks - rev: v4.6.0 + rev: v6.0.0 hooks: - id: check-yaml - id: end-of-file-fixer @@ -21,31 +21,31 @@ repos: - id: check-toml - id: check-added-large-files - repo: https://github.com/psf/black - rev: 24.4.2 + rev: 26.3.1 hooks: - id: black - repo: https://github.com/pycqa/flake8 - rev: 7.0.0 + rev: 7.3.0 hooks: - id: flake8 - repo: https://github.com/pycqa/isort - rev: 5.13.2 + rev: 9.0.0a3 hooks: - id: isort args: ["--profile", "black"] - repo: https://github.com/kynan/nbstripout - rev: 0.7.1 + rev: 0.9.1 hooks: - id: nbstripout - repo: https://github.com/pre-commit/pre-commit-hooks - rev: v4.4.0 + rev: v6.0.0 hooks: - id: no-commit-to-branch name: Prevent Commit to Main Branch args: ["--branch", "main"] stages: [pre-commit] - repo: https://github.com/codespell-project/codespell - rev: v2.3.0 + rev: v2.4.2 hooks: - id: codespell additional_dependencies: @@ -58,8 +58,8 @@ repos: additional_dependencies: - "prettier@^3.2.4" # docformatter - PEP 257 compliant docstring formatter - - repo: https://github.com/s-weigand/docformatter - rev: 5757c5190d95e5449f102ace83df92e7d3b06c6c + - repo: https://github.com/PyCQA/docformatter + rev: v1.7.8 hooks: - id: docformatter additional_dependencies: [tomli] diff --git a/news/precomit-autofix.rst b/news/precomit-autofix.rst new file mode 100644 index 0000000..fd2c95c --- /dev/null +++ b/news/precomit-autofix.rst @@ -0,0 +1,23 @@ +**Added:** + +* No News Added: Style change made with pre-commit auto-fixers. No functional changes were made to the code. + +**Changed:** + +* + +**Deprecated:** + +* + +**Removed:** + +* + +**Fixed:** + +* + +**Security:** + +* diff --git a/src/diffpy/labpdfproc/tools.py b/src/diffpy/labpdfproc/tools.py index 305291e..cb03aca 100644 --- a/src/diffpy/labpdfproc/tools.py +++ b/src/diffpy/labpdfproc/tools.py @@ -113,8 +113,10 @@ def _expand_user_input(args): def set_input_lists(args): - """Set input directory and files. It takes cli inputs, checks if - they are files or directories and creates a list of files to be + """Set input directory and files. + + It takes cli inputs, checks if they are files or directories + and creates a list of files to be processed which is stored in the args Namespace. Parameters @@ -132,7 +134,6 @@ def set_input_lists(args): args : argparse.Namespace The updated arguments with the modified input list. """ - input_paths = [] args = _expand_user_input(args) for input_name in args.input: @@ -224,7 +225,6 @@ def load_wavelength_from_config_file(args): args : argparse.Namespace The updated arguments with the updated wavelength and anode type. """ - if args.wavelength is not None: return normalize_wavelength(args) @@ -453,7 +453,6 @@ def load_user_metadata(args): The updated argparse Namespace with user metadata inserted as key-value pairs. """ - reserved_keys = set(vars(args).keys()) if args.user_metadata: @@ -479,10 +478,12 @@ def load_user_metadata(args): def load_user_info(args): - """Load user info into args. If none is provided, call - check_and_build_global_config function from diffpy.utils to prompt - the user for inputs. Otherwise, call get_user_info with the provided - arguments. + """Load user info into args. + + If none is provided, call check_and_build_global_config + function from diffpy.utils to prompt + the user for inputs. Otherwise, call get_user_info + with the provided arguments. Parameters ---------- @@ -550,9 +551,11 @@ def _check_saved_file_exists(args): def preprocessing_args(args): - """Perform preprocessing on the provided args. The process includes - loading package and user information, setting input, output, - wavelength, anode type, xtype, mu*D, and loading user metadata. + """Perform preprocessing on the provided args. + + The process includes loading package and user information, + setting input, output, wavelength, anode type, xtype, + mu*D, and loading user metadata. Parameters ----------