Skip to content

Conversation

@JessyBarrette
Copy link
Member

This pull request introduces pre-commit hooks and code quality tooling, updates development dependencies, and makes several minor code quality and correctness improvements. The main focus is on improving code consistency, enforcing linting standards, and fixing minor issues in file handling and exception raising.

Tooling and configuration:

  • Added .pre-commit-config.yaml to set up pre-commit hooks for YAML checks, whitespace fixes, and code linting/formatting with Ruff.
  • Updated pyproject.toml to include pre-commit as a development dependency and added detailed Ruff configuration for linting and formatting, including target Python version and per-file ignores for tests. [1] [2]

Code quality and correctness:

  • Replaced deprecated or incorrect usage of assert ValueError(...) with raise ValueError(...) in cioos_metadata_conversion/erddap.py for proper error handling.
  • Updated type annotation from Union[str, list] to str | list for modern Python type hinting in cioos_metadata_conversion/erddap.py.
  • Removed unnecessary "r" mode from open() calls in several places, as "r" is the default mode. This improves code clarity in cioos_metadata_conversion/record.py and tests/test_datacite.py. [1] [2] [3] [4]
  • Removed unused import of Union from cioos_metadata_conversion/erddap.py.

Other minor changes:

  • Removed unnecessary pass statement in the CLI definition in cioos_metadata_conversion/__main__.py.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants