Skip to content
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

Package Template + Linting changes #347

Merged
merged 6 commits into from
Dec 17, 2024
Merged

Package Template + Linting changes #347

merged 6 commits into from
Dec 17, 2024

Conversation

nabobalis
Copy link
Contributor

@nabobalis nabobalis commented Dec 16, 2024

Fixes #342

Summary by Sourcery

Enhance linting configuration and update pre-commit hooks to latest versions. Refactor test fixtures and reorder all lists for consistency. Update CI configuration to support Python 3.13 and latest LTS OS version. Remove '-n auto' option from pytest commands in CI. Update author email and add Python 3.13 support in project configuration.

Enhancements:

  • Update the linting configuration to use a more comprehensive set of rules and extend the list of ignored warnings.
  • Refactor test fixtures to remove unnecessary parentheses from pytest decorators.
  • Reorder elements in all lists across multiple modules for consistency.

Build:

  • Update pre-commit hooks to use the latest versions of docformatter, autoflake, ruff, and prettier.

CI:

  • Modify the CI configuration to support Python 3.13 and update the operating system to the latest LTS version.

Tests:

  • Remove the use of the '-n auto' option in pytest commands within the CI configuration.

Chores:

  • Update author email in pyproject.toml and add support for Python 3.13 in the project configuration.

Copy link
Contributor

sourcery-ai bot commented Dec 16, 2024

Reviewer's Guide by Sourcery

This PR implements various linting and code style improvements across the codebase. The main changes include updating the Ruff configuration to use ALL rules with specific ignores, modernizing pre-commit hooks, standardizing pytest fixtures, and making various code style improvements.

No diagrams generated as the changes look simple and do not need a visual representation.

File-Level Changes

Change Details Files
Updated Ruff linting configuration to be more comprehensive
  • Switched from selecting specific rules to using ALL rules with explicit ignores
  • Added new ignore rules for type annotations, docstring formatting, and TODOs
  • Added per-file ignores for test files, examples, and documentation
  • Updated exclude patterns to use extend-exclude
ruff.toml
Modernized pre-commit hook configurations
  • Updated docformatter and autoflake repository URLs
  • Updated ruff-pre-commit to v0.8.2
  • Updated pre-commit-hooks to v5.0.0
  • Switched to rbubley's mirrors-prettier
.pre-commit-config.yaml
Standardized pytest fixture decorators and test markers
  • Removed empty parentheses from @pytest.fixture decorators
  • Removed parentheses from @pytest.mark.remote_data decorators
aiapy/calibrate/tests/test_spikes.py
aiapy/calibrate/tests/test_meta.py
aiapy/conftest.py
aiapy/calibrate/tests/test_prep.py
aiapy/response/tests/test_channel.py
aiapy/psf/tests/conftest.py
Updated project configuration and dependencies
  • Added Python 3.13 support
  • Updated author email
  • Removed pytest-xdist dependency
  • Updated build configurations for tox and ReadTheDocs
pyproject.toml
tox.ini
.readthedocs.yml
Made various code quality improvements
  • Standardized variable naming (Nx/Ny to nx/ny)
  • Sorted all lists alphabetically
  • Added return type annotations
  • Created new data manager module to handle parfive downloads
aiapy/psf/psf.py
aiapy/__init__.py
aiapy/response/channel.py
aiapy/data/_manager.py

Tips and commands

Interacting with Sourcery

  • Trigger a new review: Comment @sourcery-ai review on the pull request.
  • Continue discussions: Reply directly to Sourcery's review comments.
  • Generate a GitHub issue from a review comment: Ask Sourcery to create an
    issue from a review comment by replying to it.
  • Generate a pull request title: Write @sourcery-ai anywhere in the pull
    request title to generate a title at any time.
  • Generate a pull request summary: Write @sourcery-ai summary anywhere in
    the pull request body to generate a PR summary at any time. You can also use
    this command to specify where the summary should be inserted.

Customizing Your Experience

Access your dashboard to:

  • Enable or disable review features such as the Sourcery-generated pull request
    summary, the reviewer's guide, and others.
  • Change the review language.
  • Add, remove or edit custom review instructions.
  • Adjust other review settings.

Getting Help

Copy link
Contributor

@sourcery-ai sourcery-ai bot left a comment

Choose a reason for hiding this comment

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

Hey @nabobalis - I've reviewed your changes and they look great!

Here's what I looked at during the review
  • 🟢 General issues: all looks good
  • 🟢 Security: all looks good
  • 🟢 Testing: all looks good
  • 🟢 Complexity: all looks good
  • 🟢 Documentation: all looks good

Sourcery is free for open source - if you like our reviews please consider sharing them ✨
Help me be more useful! Please click 👍 or 👎 on each comment and I'll use the feedback to improve your reviews.

aiapy/data/_manager.py Outdated Show resolved Hide resolved
nabobalis and others added 4 commits December 16, 2024 12:03
Co-authored-by: sourcery-ai[bot] <58596630+sourcery-ai[bot]@users.noreply.github.com>
@nabobalis nabobalis force-pushed the offline branch 6 times, most recently from b32db80 to 4964aff Compare December 17, 2024 00:08
@nabobalis nabobalis changed the title Linting changes Package Template + Linting changes Dec 17, 2024
@nabobalis nabobalis force-pushed the offline branch 3 times, most recently from 3ff1f7e to 33aa541 Compare December 17, 2024 00:47
@nabobalis nabobalis merged commit 4704c69 into main Dec 17, 2024
12 of 16 checks passed
@nabobalis nabobalis deleted the offline branch December 17, 2024 01:03
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.

Remplate package with https://github.com/sunpy/package-template
1 participant