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

Add the ruff INP001 rule #2445

Merged
merged 4 commits into from
Jan 8, 2025
Merged

Conversation

samtygier-stfc
Copy link
Collaborator

@samtygier-stfc samtygier-stfc commented Jan 6, 2025

Issue

Closes #2444

Description

Enable ruff INP001 rule to catch missing __init__.py files.
Use per-file-ignores to prevent false positives on stand alone scripts
Update ruff to allow negative per-file-ignores rules
Add missing __init__.py in palette_changer/test

Testing & Acceptance Criteria

Try removing a __init__.py file and run make ruff

Documentation

Release notes

This check that every directory with a python file has a __init__.py
Ignore directories outside the mantidimaging package, as these have some standalone files
@samtygier-stfc samtygier-stfc force-pushed the 2444-ruff-implicit-namespace-package branch from 678da0e to bbd5552 Compare January 6, 2025 17:20
@samtygier-stfc samtygier-stfc added the rebuild_docker 🐋 Add if you want to force rebuild docker images (ONLY IF MERGING INTO MAIN) label Jan 6, 2025
@coveralls
Copy link

coveralls commented Jan 6, 2025

Coverage Status

coverage: 73.618%. remained the same
when pulling 029d209 on 2444-ruff-implicit-namespace-package
into 9278674 on main.

@samtygier-stfc samtygier-stfc marked this pull request as ready for review January 7, 2025 13:43
Copy link
Collaborator

@JackEAllen JackEAllen left a comment

Choose a reason for hiding this comment

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

Thank you turning on the per-file-ignores rule in Ruff. I can confirm that running make ruff will now find missing __init__.py files. Happy to approve! 👍

@JackEAllen JackEAllen added this pull request to the merge queue Jan 8, 2025
Merged via the queue into main with commit 6b22531 Jan 8, 2025
8 checks passed
@JackEAllen JackEAllen deleted the 2444-ruff-implicit-namespace-package branch January 8, 2025 10:35
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
rebuild_docker 🐋 Add if you want to force rebuild docker images (ONLY IF MERGING INTO MAIN)
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Enable ruff implicit-namespace-package rule for source directory
3 participants