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

Fix: checking multiple files #126

Merged
merged 8 commits into from
Feb 24, 2025

Conversation

LoicRiegel
Copy link
Contributor

Discussion #125

About the changes:

When users provide multiple files or patterns to check:

  • duplicates are removed
  • exit with status 1 if any pattern is an invalid pattern or does not match anything
  • the files or patterns (valid or not) are returned in order (that's why I used IndexSet, hope it's okay to add it as a dependancy)

Results

You can test it yourself too, but here are a few screenshots:

User provides one valid file and a invalid glob pattern --> exit with 1

image

Check that duplicates are removed, and ``good2.py´` is analyzed first

image

Check that options, flags and runtime args are skipped - full example

image

Next steps

I'm waiting for your review, I'm new to Rust so feel free to tell me what could be improved / done in a more idiomatic way etc...

I ran cargo fmt and cargo clippy, but tell me if there are something else that I need to do.

And I will of course squash everything when we're good, and rebase if you want.

@mtshiba mtshiba self-requested a review February 23, 2025 03:56
@LoicRiegel
Copy link
Contributor Author

Thanks for your review. I did the fixes your suggested. The branch is rebased with main, and my fork is in sync. I can squash if you want, but you can also just "Squash & merge" from GitHub

@mtshiba
Copy link
Owner

mtshiba commented Feb 24, 2025

OK, I'll do so.

@mtshiba mtshiba merged commit f0a44bf into mtshiba:main Feb 24, 2025
4 checks passed
@mtshiba
Copy link
Owner

mtshiba commented Feb 24, 2025

Thank you!

@LoicRiegel
Copy link
Contributor Author

You're welcome, happy to help!
The pre-commit hook should work now, I'll check that later

@LoicRiegel LoicRiegel deleted the fix/checking-multiple-files branch February 24, 2025 23:09
@LoicRiegel
Copy link
Contributor Author

@mtshiba could you please make a new release of pylyzer? I need to have this fix on pypi for the pre-commit hook to work :)

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