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

Improved the Handling of Errors in Rule Collection #479

Merged
merged 4 commits into from
Aug 10, 2024

Conversation

surge119
Copy link
Contributor

@surge119 surge119 commented Aug 9, 2024

Summary

If a rule defined in a config contains an error or causes an error in Fixit, the linter will raise an unrecoverable error. This PR adds error handling to catch and log those errors as warnings, and continue linting

Test Plan

$ hatch run fixit lint ./src/fixit/api.py
WARNING:fixit.config:Failed to load rules 'fixit.rules': CollectionError: could not import rule(s) fixit.rules
🧼 1 file clean 🧼

# Run with good rules
$ hatch run fixit lint ./src/fixit/api.py
🧼 1 file clean 🧼

@surge119 surge119 requested review from amyreese and zsol as code owners August 9, 2024 17:54
@facebook-github-bot facebook-github-bot added the CLA Signed This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed. label Aug 9, 2024
src/fixit/config.py Outdated Show resolved Hide resolved
@amyreese amyreese merged commit dfd84cb into Instagram:main Aug 10, 2024
16 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
CLA Signed This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants