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

misc: reduce max-line-length ruff setting to 130 [NFC] #3869

Merged
merged 12 commits into from
Feb 10, 2025

Conversation

superlopuh
Copy link
Member

I don't know if we'll ever get to 88, but it feels like it would be good to get the line lengths a little more under control. In this PR, I update the line length, ignore all test files, ignore the line length limit on all assembly format strings, reflow some doc strings, and split up some inline strings in the code.

After this change, there are 840 errors when I set the line length to 88, and 313 if I set it to 100. I think without some sort of AI "fix everything" button it's a waste of time to go shorter, but our current setting of 300 definitely seems to big.

This PR contains about 60 whitespace changes.

@superlopuh superlopuh added the misc Miscellaneous label Feb 8, 2025
@superlopuh superlopuh self-assigned this Feb 8, 2025
Copy link

Check out this pull request on  ReviewNB

See visual diffs & provide feedback on Jupyter Notebooks.


Powered by ReviewNB

Comment on lines +228 to +232
with pytest.raises(
VerifyException,
match=f"The following constraints were not satisfied:\n{IntData(7)} should "
f"hold a value less than 5\n{IntData(7)} should hold a value greater than 8",
):
Copy link
Member Author

Choose a reason for hiding this comment

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

the only functional-ish change

# (2) There is no ptr.to_ptr operation currently proposed, but there is a memref.to_ptr. We do this so that we can feed the results of convert-memref-to-ptr pass without any conflict.
########

"""
Copy link
Member Author

Choose a reason for hiding this comment

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

this was a weird pseudo doc comment I made it an actual doc comment

Copy link

codecov bot commented Feb 10, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 91.24%. Comparing base (39fba80) to head (249b044).
Report is 2 commits behind head on main.

Additional details and impacted files
@@           Coverage Diff           @@
##             main    #3869   +/-   ##
=======================================
  Coverage   91.24%   91.24%           
=======================================
  Files         463      464    +1     
  Lines       57758    57780   +22     
  Branches     5572     5573    +1     
=======================================
+ Hits        52701    52723   +22     
  Misses       3630     3630           
  Partials     1427     1427           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

Comment on lines 81 to 83
"""%0, %1, %2 = "transform.structured.tile_using_for"(%3) <{static_sizes = array<i32: 8, 8>}> : (!transform.any_value) -> (!transform.any_op, !transform.any_op, !transform.any_op)""", # noqa: E501
None,
)
Copy link
Collaborator

@compor compor Feb 10, 2025

Choose a reason for hiding this comment

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

Do we need these noqa comments here since we ignore all test files above ("tests/*" = ["E501"])?
When I remove it, ruff check doesn't trigger for me unless I also remove the aforementioned line from pyproject.toml.

Copy link
Member Author

Choose a reason for hiding this comment

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

Ah you're right I'll do a pass

Copy link
Member Author

Choose a reason for hiding this comment

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

Done

@compor
Copy link
Collaborator

compor commented Feb 10, 2025

I'm happy with 100 chars of line length, although most OSS Python project seem to adhere to the PEP8 88 gospel.

Related also to #1274 (maybe close it with a comment and pointing to this PR?)

@superlopuh
Copy link
Member Author

Let's keep that open for now, and close when/if we get to 100?

@superlopuh superlopuh merged commit 317bd94 into main Feb 10, 2025
16 checks passed
@superlopuh superlopuh deleted the sasha/misc/reduce-ruff-line-length branch February 10, 2025 10:32
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
misc Miscellaneous
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants