Skip to content

Remove PT019 from cosmology-specific ignores in .ruff.toml - #4

Closed
nstarman with Copilot wants to merge 2 commits into
cosmo/lint/auto-rufffrom
copilot/fix-9a534ed3-1b67-49a6-abdd-8e62bf2dda32
Closed

nstarman with Copilot wants to merge 2 commits into
cosmo/lint/auto-rufffrom
copilot/fix-9a534ed3-1b67-49a6-abdd-8e62bf2dda32

Conversation

Copilot AI commented Sep 16, 2025 •

Copy link
Copy Markdown

This PR removes the PT019 (pytest-fixture-param-without-value) rule from the cosmology-specific ignores in .ruff.toml.

Background

PT019 is a flake8-pytest-style rule that detects pytest test functions taking fixture parameters but not using them in the test body. Such fixtures should use the @pytest.mark.usefixtures decorator instead to make the dependency explicit and avoid confusion from unused arguments.

Changes

  • Removed "PT019", # pytest-fixture-param-without-value from the "astropy/cosmology/*" section in .ruff.toml

Validation

Investigation revealed that the astropy/cosmology directory already complies with PT019 - no violations were found when the rule was enabled. This means the ignore was no longer necessary and could be safely removed without requiring any code changes.

The removal was validated by:

  • Running ruff check --select PT019 astropy/cosmology/ with no violations found
  • Confirming TOML syntax remains valid
  • Verifying other linting rules continue to work correctly

This change helps clean up the linting configuration by removing an unnecessary ignore rule, making the codebase's compliance with pytest best practices more explicit.


💬 Share your feedback on Copilot coding agent for the chance to win a $200 gift card! Click here to start the survey.

@github-actions

Copy link
Copy Markdown

Thank you for your contribution to Astropy! 🌌 This checklist is meant to remind the package maintainers who will review this pull request of some common things to look for.

  • Do the proposed changes actually accomplish desired goals?
  • Do the proposed changes follow the Astropy coding guidelines?
  • Are tests added/updated as required? If so, do they follow the Astropy testing guidelines?
  • Are docs added/updated as required? If so, do they follow the Astropy documentation guidelines?
  • Is rebase and/or squash necessary? If so, please provide the author with appropriate instructions. Also see instructions for rebase and squash.
  • Did the CI pass? If no, are the failures related? If you need to run daily and weekly cron jobs as part of the PR, please apply the "Extra CI" label. Codestyle issues can be fixed by the bot.
  • Is a change log needed? If yes, did the change log check pass? If no, add the "no-changelog-entry-needed" label. If this is a manual backport, use the "skip-changelog-checks" label unless special changelog handling is necessary.
  • Is this a big PR that makes a "What's new?" entry worthwhile and if so, is (1) a "what's new" entry included in this PR and (2) the "whatsnew-needed" label applied?
  • At the time of adding the milestone, if the milestone set requires a backport to release branch(es), apply the appropriate "backport-X.Y.x" label(s) before merge.

@github-actions

Copy link
Copy Markdown

👋 Thank you for your draft pull request! Do you know that you can use [ci skip] or [skip ci] in your commit messages to skip running continuous integration tests until you are ready?

Copilot AI changed the title [WIP] Try to remove PT019 from the cosmology-specific ignores in .ruff.toml and then fix all PT019 problems in astropy/cosmology Remove PT019 from cosmology-specific ignores in .ruff.toml Sep 16, 2025
Copilot AI requested a review from nstarman September 16, 2025 14:09
@nstarman nstarman added this to the v7.2.0 milestone Sep 16, 2025
@nstarman nstarman closed this Sep 25, 2025
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