Skip to content

Added doctest helpers to namespace and used ruff for linting / pre-commit over other older tools.#179

Merged
justin13601 merged 13 commits intomainfrom
use_ruff
May 3, 2025
Merged

Added doctest helpers to namespace and used ruff for linting / pre-commit over other older tools.#179
justin13601 merged 13 commits intomainfrom
use_ruff

Conversation

@mmcdermott
Copy link
Collaborator

@mmcdermott mmcdermott commented Apr 27, 2025

This should be a purely stylistic change, and not affect functionality.

Summary by CodeRabbit

  • New Features

    • Added a test setup that automatically provides common utilities for doctests, improving ease of writing and running tests.
  • Bug Fixes

    • Fixed minor typos in documentation and improved error message formatting.
  • Refactor

    • Simplified and consolidated code for aggregation, constraints checking, and command-line interface handling.
    • Reorganized imports and updated function signatures for clarity and type safety.
    • Improved logging and code style throughout the codebase.
  • Documentation

    • Enhanced documentation formatting with standardized note styles and improved readability.
    • Updated example code in docstrings for clarity and conciseness.
  • Chores

    • Updated development dependencies and pre-commit hooks for better code quality and consistency.
    • Removed unused imports and root setup code from tests, streamlining the testing process.

@mmcdermott mmcdermott requested a review from justin13601 April 27, 2025 11:41
@coderabbitai
Copy link
Contributor

coderabbitai bot commented Apr 27, 2025

Walkthrough

This set of changes focuses on modernizing development workflows, refining code style and documentation, and streamlining test and CLI infrastructure. The pre-commit configuration is overhauled to consolidate Python formatting and linting under Ruff, with several tools removed and others updated. The test infrastructure is updated to simplify imports and setup, including the removal of rootutils and improved pytest fixtures. The CLI entry point is refactored for clarity, and dependency management is reorganized in pyproject.toml. Documentation and example code are reformatted for consistency, and minor code cleanups are made throughout, with some function signatures receiving more precise type hints.

Changes

Files / Paths Change Summary
.pre-commit-config.yaml Replaces multiple Python formatting/linting hooks (black, isort, autoflake, pyupgrade, flake8) with Ruff, updates versions of prettier, shellcheck, mdformat, codespell, nbstripout, and switches notebook linting to nbqa-ruff. Python version updated to 3.12.
.github/workflows/tests.yaml Changes package installation command to use editable mode and includes both "dev" and "tests" extras for dependencies.
pyproject.toml Updates CLI entry point from main to cli, splits optional dependencies into dev, tests, and profiling, adds coverage and Ruff configuration, and refines linting rules and ignore patterns.
src/aces/run.py Refactors CLI logic by introducing a cli() function for entry point, moves imports to module level, and adjusts usage message handling.
conftest.py Adds an autouse pytest fixture to inject common modules and objects into the doctest namespace for easier testing.
src/aces/utils.py Refines type hint for parse_timedelta to explicitly allow None as a parameter value.
src/aces/predicates.py Updates doctest examples to remove redundant imports, switches list concatenation to unpacking syntax, and refines type hints for function parameters.
src/aces/aggregate.py, src/aces/constraints.py, src/aces/extract_subtree.py, Cleans up docstring examples by removing redundant imports, simplifies conditional logic, and updates tuple/list construction syntax for clarity and conciseness.
src/aces/query.py, src/aces/types.py Updates docstring examples to use caplog for log capture and removes doctest normalization directives; minor formatting improvements.
src/aces/config.py Cleans up docstring examples, removes unused imports, and simplifies some conditional expressions and string formatting.
src/aces/__init__.py Adds a blank line after the module docstring for style consistency.
README.md, docs/source/configuration.md, docs/source/usage.md Reformats notes and admonitions to use GitHub-flavored blockquote style for improved readability and consistency.
docs/source/conf.py Moves sphinx.ext.apidoc import to the top of the file, removing redundancy.
docs/source/notebooks/examples.ipynb, docs/source/notebooks/tutorial_esgpt.ipynb, Removes unused imports and simplifies file opening statements in notebook examples.
docs/source/notebooks/tutorial_meds.ipynb Removes unused imports and simplifies file opening statements in notebook examples.
tests/test_aggregate_hypothesis.py, tests/test_e2e.py, tests/test_expand_shards.py, Removes rootutils setup, simplifies assertions and formatting, and updates test code for clarity.
tests/test_help_message.py, tests/test_meds.py, tests/test_other_meds.py, Removes rootutils setup and updates assertion formatting for clarity.
tests/test_override_meds.py Removes rootutils setup and a trailing comment marker in a multi-line string.
tests/utils.py Removes rootutils setup, updates type hints for optional parameters, and refines dictionary formatting and assertion style.

Sequence Diagram(s)

sequenceDiagram
    participant User
    participant CLI (cli)
    participant Main (main)
    participant Core Modules

    User->>CLI (cli): Run aces-cli [args]
    CLI (cli)->>CLI (cli): Print usage if no args
    CLI (cli)->>Main (main): Call main(cfg)
    Main (main)->>Core Modules: Import and execute core logic
Loading

Possibly related PRs

  • justin13601/ACES#106: Also modifies .pre-commit-config.yaml, specifically the autoflake hook, which is removed in this PR.
  • justin13601/ACES#135: Updates type hints in parse_timedelta in src/aces/utils.py, similar to the refinement in this PR.
  • justin13601/ACES#173: Alters CLI entry point configuration in pyproject.toml and related logic, overlapping with this PR's CLI changes.

Poem

A rabbit hopped through code and lint,
Tidied up the docs with a gentle hint.
Ruff now polishes every line,
The CLI’s new entry point is looking fine!
Imports trimmed, examples neat,
This modern warren is hard to beat.
🐇✨

✨ Finishing Touches
  • 📝 Generate Docstrings

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share
🪧 Tips

Chat

There are 3 ways to chat with CodeRabbit:

  • Review comments: Directly reply to a review comment made by CodeRabbit. Example:
    • I pushed a fix in commit <commit_id>, please review it.
    • Generate unit testing code for this file.
    • Open a follow-up GitHub issue for this discussion.
  • Files and specific lines of code (under the "Files changed" tab): Tag @coderabbitai in a new review comment at the desired location with your query. Examples:
    • @coderabbitai generate unit testing code for this file.
    • @coderabbitai modularize this function.
  • PR comments: Tag @coderabbitai in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:
    • @coderabbitai gather interesting stats about this repository and render them as a table. Additionally, render a pie chart showing the language distribution in the codebase.
    • @coderabbitai read src/utils.ts and generate unit testing code.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.
    • @coderabbitai help me debug CodeRabbit configuration file.

Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments.

CodeRabbit Commands (Invoked using PR comments)

  • @coderabbitai pause to pause the reviews on a PR.
  • @coderabbitai resume to resume the paused reviews.
  • @coderabbitai review to trigger an incremental review. This is useful when automatic reviews are disabled for the repository.
  • @coderabbitai full review to do a full review from scratch and review all the files again.
  • @coderabbitai summary to regenerate the summary of the PR.
  • @coderabbitai generate docstrings to generate docstrings for this PR.
  • @coderabbitai generate sequence diagram to generate a sequence diagram of the changes in this PR.
  • @coderabbitai resolve resolve all the CodeRabbit review comments.
  • @coderabbitai configuration to show the current CodeRabbit configuration for the repository.
  • @coderabbitai help to get help.

Other keywords and placeholders

  • Add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.
  • Add @coderabbitai summary to generate the high-level summary at a specific location in the PR description.
  • Add @coderabbitai anywhere in the PR title to generate the title automatically.

CodeRabbit Configuration File (.coderabbit.yaml)

  • You can programmatically configure CodeRabbit by adding a .coderabbit.yaml file to the root of your repository.
  • Please see the configuration documentation for more information.
  • If your editor has YAML language server enabled, you can add the path at the top of this file to enable auto-completion and validation: # yaml-language-server: $schema=https://coderabbit.ai/integrations/schema.v2.json

Documentation and Community

  • Visit our Documentation for detailed information on how to use CodeRabbit.
  • Join our Discord Community to get help, request features, and share feedback.
  • Follow us on X/Twitter for updates and announcements.

@codecov
Copy link

codecov bot commented Apr 27, 2025

Codecov Report

❌ Patch coverage is 96.77419% with 1 line in your changes missing coverage. Please review.

Files with missing lines Patch % Lines
src/aces/config.py 83.33% 1 Missing ⚠️
Files with missing lines Coverage Δ
src/aces/__init__.py 100.00% <ø> (ø)
src/aces/aggregate.py 100.00% <100.00%> (ø)
src/aces/constraints.py 100.00% <100.00%> (ø)
src/aces/extract_subtree.py 100.00% <100.00%> (ø)
src/aces/predicates.py 87.78% <100.00%> (+0.76%) ⬆️
src/aces/query.py 100.00% <ø> (ø)
src/aces/run.py 100.00% <100.00%> (ø)
src/aces/types.py 100.00% <100.00%> (ø)
src/aces/utils.py 100.00% <100.00%> (ø)
src/aces/config.py 99.76% <83.33%> (-0.01%) ⬇️
🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@mmcdermott mmcdermott marked this pull request as ready for review April 27, 2025 12:28
Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 1

🧹 Nitpick comments (5)
docs/source/usage.md (3)

9-10: Convert inline note to admonition for consistency
The inline "Note:" near the installation section can be updated to a blockquote admonition (> [!NOTE]) to match the formatting used elsewhere in this document.

Apply:

- **Note:** If you choose to use the ESGPT standard, please install ESGPT first before installing ACES. This ensures compatibility with the `polars` version required by ACES.
+ > [!NOTE]
+ > If you choose to use the ESGPT standard, please install ESGPT first before installing ACES. This ensures compatibility with the `polars` version required by ACES.

71-72: Add missing comma for readability
Consider adding a comma before "and" to improve clarity:

- ... a prediction is made and can be set to `start` or `end` of a particular window.
+ ... a prediction is made, and can be set to `start` or `end` of a particular window.
🧰 Tools
🪛 LanguageTool

[uncategorized] ~71-~71: Possible missing comma found.
Context: ... the timestamp at which a prediction is made and can be set to start > or end of...

(AI_HYDRA_LEO_MISSING_COMMA)


242-243: Capitalize the first word in admonition text
The admonition starts with a lowercase "you". For consistency, capitalize it:

- > you may have to run this command for every terminal - please visit [Hydra's Documentation]...
+ > You may have to run this command for every terminal - please visit [Hydra's Documentation]...
src/aces/types.py (1)

147-152: Clarify class docstring for event-based windows
The docstring for ToEventWindowBounds still reads "temporal window bounds" but should reflect that this class represents event-bound windows.

Apply:

-    """Named tuple to represent temporal window bounds.
+    """Named tuple to represent event-bound window bounds.
pyproject.toml (1)

65-83: Configure Ruff linter with target version, line length, and selected rule sets.
Centralizes linting and formatting under Ruff, matching .pre-commit-config.yaml. The selected codes (E, F, B, etc.) cover a broad range of checks—consider periodically reviewing ignored rules to catch new issues.

📜 Review details

Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between eb45f80 and bf56ad1.

📒 Files selected for processing (29)
  • .github/workflows/tests.yaml (1 hunks)
  • .pre-commit-config.yaml (3 hunks)
  • README.md (4 hunks)
  • conftest.py (1 hunks)
  • docs/source/conf.py (1 hunks)
  • docs/source/configuration.md (5 hunks)
  • docs/source/notebooks/examples.ipynb (0 hunks)
  • docs/source/notebooks/tutorial_esgpt.ipynb (1 hunks)
  • docs/source/notebooks/tutorial_meds.ipynb (1 hunks)
  • docs/source/usage.md (3 hunks)
  • pyproject.toml (2 hunks)
  • src/aces/__init__.py (1 hunks)
  • src/aces/aggregate.py (3 hunks)
  • src/aces/config.py (37 hunks)
  • src/aces/constraints.py (2 hunks)
  • src/aces/extract_subtree.py (2 hunks)
  • src/aces/predicates.py (6 hunks)
  • src/aces/query.py (3 hunks)
  • src/aces/run.py (3 hunks)
  • src/aces/types.py (13 hunks)
  • src/aces/utils.py (1 hunks)
  • tests/test_aggregate_hypothesis.py (1 hunks)
  • tests/test_e2e.py (0 hunks)
  • tests/test_expand_shards.py (1 hunks)
  • tests/test_help_message.py (1 hunks)
  • tests/test_meds.py (3 hunks)
  • tests/test_other_meds.py (0 hunks)
  • tests/test_override_meds.py (1 hunks)
  • tests/utils.py (4 hunks)
💤 Files with no reviewable changes (3)
  • docs/source/notebooks/examples.ipynb
  • tests/test_other_meds.py
  • tests/test_e2e.py
🧰 Additional context used
🧬 Code Graph Analysis (2)
src/aces/predicates.py (1)
src/aces/config.py (2)
  • PlainPredicateConfig (35-238)
  • TaskExtractorConfig (859-1689)
src/aces/run.py (1)
src/aces/query.py (1)
  • query (19-197)
🪛 LanguageTool
docs/source/usage.md

[uncategorized] ~71-~71: Possible missing comma found.
Context: ... the timestamp at which a prediction is made and can be set to start > or end of...

(AI_HYDRA_LEO_MISSING_COMMA)

docs/source/configuration.md

[uncategorized] ~164-~164: Loose punctuation mark.
Context: ...REFERENCING = $REFERENCED -> $PREDICATE, $REFERENCING = $REFERENCED <- $PREDICA...

(UNLIKELY_OPENING_PUNCTUATION)

🪛 GitHub Check: codecov/patch
src/aces/config.py

[warning] 1650-1650: src/aces/config.py#L1650
Added line #L1650 was not covered by tests

🔇 Additional comments (55)
src/aces/__init__.py (1)

5-5: Add blank line after module docstring
The blank line inserted after the closing triple-quote enhances readability and aligns with PEP 257’s recommendation of having one blank line between the module docstring and the first import.

docs/source/notebooks/tutorial_esgpt.ipynb (1)

89-89: Remove explicit read mode in open()
Relying on the default read mode by using open(config_path) simplifies the code without changing behavior.

docs/source/notebooks/tutorial_meds.ipynb (1)

90-90: Simplify YAML file opening call
Dropping the explicit "r" mode argument (open(config_path)) leverages the default read mode, cleaning up the code while preserving functionality.

src/aces/extract_subtree.py (1)

290-290: Use tuple unpacking for endpoint expressions
Changing from concatenation (endpoint_expr + (subtree_root_offset,)) to unpacking ((*endpoint_expr, subtree_root_offset)) is functionally equivalent and more idiomatic for combining tuples.

conftest.py (1)

1-33: Introduce autouse fixture for doctest namespace
The _setup_doctest_namespace fixture automatically injects common utilities (e.g., caplog, json, pl, yaml, MagicMock, patch, datetime, timedelta, tempfile) into the doctest environment, streamlining examples by removing boilerplate imports.

src/aces/constraints.py (2)

19-19: Spelling correction in docstring

The typo "satsified" was correctly fixed to "satisfied".


98-100: Improved validation logic

Good refactoring to consolidate the constraint validation logic into a single if-statement with a logical OR. This makes the code more concise while maintaining the same behavior.

docs/source/conf.py (1)

7-8: Import organization improvement

Moving the sphinx.ext.apidoc import statement to the top of the file with other imports follows Python best practices for import organization. This improves code readability and maintainability.

tests/test_expand_shards.py (1)

11-13: Improved assertion formatting

The assertion has been reformatted from a multi-line expression to a cleaner style with a trailing comma and parenthesized error message. This improves readability while maintaining the same functionality.

tests/test_override_meds.py (1)

372-372: Removed unnecessary lint suppression comment

Removed the # noqa: E501 comment that was previously used to suppress line length warnings. This aligns with the PR objective of using ruff for linting, which likely handles this differently.

tests/test_help_message.py (1)

9-11: Approve single-line assertion formatting.

The refactored assertion consolidates the multi-line check into a concise single-line format without altering logic or expected output.

src/aces/utils.py (1)

14-14: Approve explicit optional type hint.

Updating the signature to str | None clarifies that time_str may be None and leverages Python 3.10+ union syntax consistently with the rest of the codebase.

.github/workflows/tests.yaml (1)

29-29: Verify extras groups alignment.

Ensure that the extras dev and tests are defined in pyproject.toml and include the intended dependencies for development and testing.

docs/source/configuration.md (1)

53-57: Approve standardized [!NOTE] admonitions.

The conversion from inline bold **Note** to the GitHub-flavored blockquote [!NOTE] format is consistent and enhances readability without altering content.

Also applies to: 86-90, 114-117, 159-163, 168-174, 204-210

tests/test_aggregate_hypothesis.py (1)

101-104: Approve inline conditional refactor.

Refactoring the timestamp filters to inline conditional expressions maintains original behavior while improving readability.

docs/source/usage.md (2)

23-23: Documentation content formatting is correct
This paragraph clearly explains the task configuration example and has been integrated correctly.


64-70: Admonition block is well-formed and informative
The [!NOTE] block standardizes the explanation of configuration file structure and index_timestamp usage.

README.md (3)

10-10: Approve GitHub Actions badge extension update
The badge URL has been corrected from .yml to .yaml for the tests workflow, and the link now points to tests.yaml.


22-24: Approve updates section entries
The new release notes and formatting for dates in the "Updates" section are accurate and consistent with the project timeline.


63-66: Admonition block is well-formed
The [!NOTE] block now clearly highlights the dependency installation order, matching the style used elsewhere.

tests/test_meds.py (2)

610-612: Assertion formatting is consistent and clear
The multi-line assertion with a parenthesized message enhances readability and aligns with PEP8.


624-626: Assertion formatting is consistent and clear
The update formats the assertion message across multiple lines for clarity and maintainability.

src/aces/types.py (4)

25-56: Doctest examples cleaned up appropriately
The removal of # doctest: +NORMALIZE_WHITESPACE directives in the TemporalWindowBounds docstring does not affect functionality and simplifies the examples.


75-125: Polars rolling kwargs examples updated correctly
The doctest blocks for polars_gp_rolling_kwargs are clear, and the formatting improvements enhance readability without altering behavior.


146-214: Event window bounds doctests are correct
The ToEventWindowBounds docstring examples have been simplified and remain accurate for testing edge cases.


309-312: Refactor end_event assignment is concise and correct
The single-line conditional for end_event maintains the same logic in a more readable form.

src/aces/query.py (4)

63-66: Doctest examples now use caplog for log capture
Switching to caplog.at_level(logging.INFO) makes the examples more idiomatic for pytest and leverages the injected fixture.


86-95: Static variable filtering doctest updated
The refactored examples correctly demonstrate checking log messages via caplog.text.


102-105: Trigger event absence doctest updated
Using caplog in the doctest maintains consistency and clarity in the test examples.


163-165: Consolidate logger.info into a single line
The refactored f-string for label extraction logging is concise and functionally identical.

src/aces/run.py (2)

4-5: Good refactoring: moved imports to the module level.

This change follows Python best practices by placing imports at the module level instead of inside functions, improving readability and potentially reducing runtime overhead since these imports are no longer executed each time the function is called.

Also applies to: 6-9, 15-17


180-188: Well-structured CLI entry point.

The new cli() function nicely encapsulates the command-line interface logic, separating it from the core functionality in main(). This improves modularity and maintainability. The function provides helpful usage information when no arguments are provided, enhancing the user experience.

tests/utils.py (3)

29-29: Improved type annotations.

Changing from str to str | None for the msg and predicate_files parameters provides more accurate type information, which enhances static type checking and code clarity.

Also applies to: 81-81


123-123: Nice code optimizations.

Two good improvements here:

  1. Using data_dir.resolve()!s instead of str(data_dir.resolve()) is more idiomatic
  2. Replacing list(wrote_files.values())[0] with next(iter(wrote_files.values())) avoids unnecessary list creation, making it more efficient

Both changes maintain functionality while improving code quality.

Also applies to: 125-125


148-150: Better assertion formatting.

Reformatting the assertion to use a single-line condition with a multi-line error message improves readability while maintaining the same functionality.

src/aces/aggregate.py (3)

974-977: Good Boolean logic simplification.

The conditions for determining right_inclusive and left_inclusive were elegantly simplified using membership checks (in and not in), making the code more readable and concise without changing functionality.

Also applies to: 982-985


1005-1007: Nice conditional consolidation.

Combining these separate conditions using an or operator simplifies the code while maintaining the same logic, reducing cognitive load for readers and making maintenance easier.


1099-1101: Effective condition combination.

Similar to the previous change, this consolidation of conditions with an or operator reduces branching and improves code readability without affecting the behavior.

src/aces/config.py (2)

12-13: Improved import organization with TYPE_CHECKING.

Moving the OrderedDict import under a TYPE_CHECKING guard is an excellent optimization that reduces runtime overhead while maintaining static type checking capabilities, following Python best practices for type annotations.

Also applies to: 28-30


1649-1650:

Details

❓ Verification inconclusive

Simplified conditional logic needs test coverage.

This change improves the code by checking if a child is not already in the parent's children before adding it, preventing potential duplicate entries. However, this line isn't covered by tests according to static analysis.

Consider adding test coverage for this edge case to ensure this defensive programming logic works as expected:


🏁 Script executed:

#!/bin/bash
# Check which test files might be related to this functionality
fd -e py _initialize_windows tests/
# Look for any tests that might be creating window configurations with parent-child relationships
rg "window.*parent" tests/

Length of output: 66


Ensure parent-child duplication logic is tested

I wasn’t able to find any existing tests that hit the new guard in src/aces/config.py (lines 1649–1650):

if node.parent and child not in node.parent.children:
    node.parent.children += (child,)

Please add unit tests for this edge case, for example:

  • Verify a child is appended only once when node.parent is set
  • Verify nothing happens if node.parent is None
  • Verify no duplicates when child is already in parent.children

You can add these in a new file (e.g. tests/test_config.py) or alongside related tests in your suite.

🧰 Tools
🪛 GitHub Check: codecov/patch

[warning] 1650-1650: src/aces/config.py#L1650
Added line #L1650 was not covered by tests

pyproject.toml (4)

41-41: Update CLI entry point to cli.
The aces-cli script now points to aces.run:cli, reflecting the refactored entry logic. Ensure that cli() is exported from src/aces/run.py and that any CI or packaging tests invoking the old entry point are updated.


45-47: Reorganize optional dependencies into dev, tests, and profiling groups.
Separating development, testing, and profiling extras improves clarity and keeps installations lean. Confirm that CI workflows install both [dev,tests] and that documentation mentions the new extra names.


62-64: Add coverage report exclusions.
Excluding debug logs, import errors, and type-checking blocks helps focus coverage metrics on business logic. Verify that coverage thresholds in CI reflect these exclusions.


86-91: Extend per-file ignores for __init__.py and naming conventions.
Ignoring unused imports in __init__.py is standard, and the naming ignore patterns align with project-specific constants. Looks good.

src/aces/predicates.py (4)

10-10: Import PlainPredicateConfig and TaskExtractorConfig.
Enables type hints and functionality in this module. Verify that TaskExtractorConfig is used only for get_predicates_df and doesn’t introduce unnecessary dependencies.


187-188: Use unpacking for the columns list and improve logging.
Replacing ["subject_id", "timestamp"] + predicates with ["subject_id", "timestamp", *predicates] enhances readability. The f-string now uses {data_path.resolve()!s} for concise path formatting.


284-284: Apply unpacking when selecting predicate columns in MEDS loader.
Switching from list concatenation to ["subject_id", "timestamp", *predicate_cols] keeps selection syntax consistent with other modules.


429-435: Add doctest for missing EventStream import in ESGPT loader.
Documenting the ImportError path when EventStream is absent improves example coverage and developer guidance.

.pre-commit-config.yaml (7)

1-2: Bump default Python version to 3.12 for pre-commit.
Aligns with the project’s target of Python ≥3.10 and ensures hooks run under the intended interpreter. Confirm CI runners support python3.12.


21-29: Consolidate Python linting and formatting under Ruff.
Replacing Black, isort, autoflake, pyupgrade, and flake8 hooks with ruff-format and ruff --fix streamlines toolchain and reduces maintenance. Ensure pyproject.toml’s Ruff settings cover all needed rules.


38-43: Upgrade Prettier to v4.0.0-alpha.8 for YAML formatting.
New version may alter formatting defaults; run through existing YAML files to catch any unexpected diffs.


45-50: Upgrade ShellCheck to v0.10.0.1.
Keeps shell script linting up-to-date. Verify no new warnings/errors in CI after bump.


51-66: Update mdformat to v0.7.22 and add plugins.
Including mdformat-ruff, mdformat-gfm-alerts, mdformat-myst, and mdformat-toc enhances markdown formatting. Ensure these plugins are installed in dev environments and that docs render as expected.


67-75: Upgrade codespell to v2.4.1 with refined skip patterns.
Skipping notebooks, large assets, and ignored words (ehr, crate) optimizes spelling checks. Confirm no critical terms are inadvertently skipped.


82-90: Switch notebook linting to nbqa-ruff and nbqa-ruff-format.
Leverages Ruff for both linting and formatting of Jupyter notebooks with autofix. Run sample notebooks to verify hooks behave as intended.

@justin13601 justin13601 merged commit 58dd44d into main May 3, 2025
7 of 8 checks passed
@justin13601 justin13601 deleted the use_ruff branch May 3, 2025 19:25
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