-
Notifications
You must be signed in to change notification settings - Fork 91
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
Enforcing a maximum line length of 120 #1646
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I reviewed the first half of the files changed. @opotowsky is doing the second half.
armi/physics/neutronics/globalFlux/tests/test_globalFluxInterface.py
Outdated
Show resolved
Hide resolved
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There are a ton of updates in here that increase line length. Can you undo all those changes? That creates more unnecessary work for us (it gets reviewed in this PR, then again in the 100 char line length limit PR).
This is true if the plan is to move the line length bar again. Which I don't really understand a motivation for. I can get trimming it to 120, but 100? Or 88? It seems unnecessary? |
Co-authored-by: Tony Alberti <aalberti@terrapower.com>
Well, two weeks ago, we had lines that were >200 characters long. That is a bit too much, even for me. I tend to work at 120. Though... 88 is by a WIDE margin the most common. For instance, that is the default in both To be clear, I wasn't really interested in lowering the bar again. But I am by FAR in the minority here. I just happen to find that scientific code has long lines of math that mean stringent line-length limits make code harder to read and parse. Perhaps the "88 character limit" comes from website development and other work of that sort, where no individual line has a LOT of math to it. |
armi/physics/neutronics/globalFlux/tests/test_globalFluxInterface.py
Outdated
Show resolved
Hide resolved
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I reviewed the bottom 26 files.
I originally commented that lines already adjusted to a 100 char limit shouldn't be increased to 120. But we discussed that and since we aren't probably ever going to enforce a 100 char line length, I was OK leaving those edits as-is.
I now noticed a bunch of places where a 120 char line was edited down to a 100 char line. I commented on it in one file, but once I saw how pervasive the inconsistency was I stopped commenting. It's not the biggest deal....after all, these lines technically follow the <120 rule. But how this got inconsistently applied is baffling to me. Is it ruff
misbehaving? Your error?
@@ -33,8 +33,8 @@ def getBlockParameterDefinitions(): | |||
"orientation", | |||
units=units.DEGREES, | |||
description=( | |||
"Triple representing rotations counterclockwise around each spatial axis. For example, " | |||
"a hex assembly rotated by 1/6th has orientation (0,0,60.0)" | |||
"Triple representing rotations counterclockwise around each spatial axis. For " |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
same as below....seems like some line wraps get 100 chars applied and some get 120
"Duration that a block has been in the core multiplied by the fraction " | ||
"of full power generated in that time." |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
same comment as below
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The first 26 files are good.
Co-authored-by: Arrielle Opotowsky <c-aopotowsky@terrapower.com>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I still approve the first 26 files. @opotowsky to approve the second half.
I can approve this once my review is responded to. Looks like I have an outstanding british v american english spelling thing, and question for my review. John partially answered my questions about the 100 vs 120 char issue, but it seems the inconsistency is broader than the question that was answered (that related to impl tags). |
Co-authored-by: Arrielle Opotowsky <c-aopotowsky@terrapower.com>
What is the change?
Using
ruff
to enforce a maximum line length of 120. Becauseruff
is doing the enforcing, GitHub CI will catch and enforce this new rule in the future.This was mostly an automated process, though I did have to touch the
pyproject.toml
by hand, and I touched the release notes.Why is the change being made?
This is purely for code quality and readability; lines that are longer than 120 characters are pretty hard to read on a
git diff
or even the "GitHub Diff" UI in PRs. They also add to a lot of clutter and confusion in most IDEs.We could also move the bar to 100 characters, which would be more standard. But...
ruff
tells me that would make changes to 768 files, and that feels like too big a pill to swallow.Checklist
doc/release/0.X.rst
) are up-to-date with any important changes.doc
folder.pyproject.toml
.