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

Unsorted and Unformatted Import Blocks in Multiple Files #10261

Open
ananyakaligal opened this issue Jan 3, 2025 · 7 comments
Open

Unsorted and Unformatted Import Blocks in Multiple Files #10261

ananyakaligal opened this issue Jan 3, 2025 · 7 comments

Comments

@ananyakaligal
Copy link
Contributor

Description:
There are multiple instances of unsorted or unformatted import blocks across the codebase, violating the I001 rule from Ruff. This affects the readability and maintainability of the code.

Action Items

  • Review and reorganize import statements to adhere to PEP 8 guidelines:
    • Standard library imports should come first.
    • Third-party imports should follow.
    • Local application imports should be last.
  • Rerun Ruff to confirm the resolution of the I001 linting issue.

Additional Notes
This cleanup will enhance code quality and ensure compliance with our coding standards.

@RayBB please review this and let me know if this is something we should address. Once approved, I can begin working on it.

@RayBB
Copy link
Collaborator

RayBB commented Jan 3, 2025

I'm not quite sure I understand since that rule is already enabled. Is it possible you're using an older version of ruff that's formatting it differently?

Feel free to open a PR showing an example of what should change. That could make it clearer.

@RayBB
Copy link
Collaborator

RayBB commented Jan 4, 2025

According to your comment in the issue you are on a modern version of ruff.

Can you share at what moment you're getting these erros? Perhaps the IDE is configured with a different auto formatter which is conflicting with the ruff pre-commit hook?

@ananyakaligal
Copy link
Contributor Author

@RayBB The rule is enabled, but the errors aren't fixed. I’ll attach a screenshot of the error I'm seeing. I'm unsure why this is happening since my IDE isn't set up with any auto-formatters.
Screenshot from 2025-01-06 18-05-56

@RayBB
Copy link
Collaborator

RayBB commented Jan 6, 2025 via email

@ananyakaligal
Copy link
Contributor Author

@RayBB ruff check .

@RayBB
Copy link
Collaborator

RayBB commented Jan 7, 2025

@ananyakaligal could you try uninstalling and reinstalling ruff?
I really don't know how you can have the same ruff version and be getting different results.
The only thing I can think of is if you're not on the latest commit of master so maybe the rules are different? But that seems unlikely.

If the above doesn't work here are two options:

  1. If you're able to join the community call tomorrow maybe you can mention it and see what ideas other have
  2. If you can't make it you can post in openlibrary-g slack channel (you can post there anyway but on the call you might get more ideas)

@ananyakaligal
Copy link
Contributor Author

@RayBB The above two suggestions still gave me an error. I am not sure whether I will be able to make it to the meeting, if not i will post on the slack channel. Thankyou

@github-actions github-actions bot added the Needs: Response Issues which require feedback from lead label Jan 8, 2025
@mekarpeles mekarpeles removed the Needs: Response Issues which require feedback from lead label Jan 13, 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 a pull request may close this issue.

3 participants