-
Notifications
You must be signed in to change notification settings - Fork 2k
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
Consolidate descriptions linter functions into one #4872
Consolidate descriptions linter functions into one #4872
Conversation
* Standardize styling for linters * Fix overuse of bolding * Fix indentation of errors * Undo changes to description tests (conflicts with #4872)
Hi @queengooborg, Florian and I talked about this in our most recent 1:1 (we're trying to get back in the habit of unblocking old PRs). It's not that we don't want to see the speed up here, but we're skittish about making changes to the linter, especially multiple changes at once (in here we've got style changes, a structural change, and what looks to be some jsdoc changes—it's not clear they're all strictly dependent on each other). I don't think we can merge this as is, so I propose closing this and approaching these things from a different angle. Looking forward, we've got three suggestions:
Let me know if there's any questions about this. Thank you! |
I just saw this PR was closed. I can understand the desire to keep changesets as small as possible, but to be honest, I don't see much room for stripping changes out. There are a couple of things I could split into other PRs like the JSDoc and formatting changes to the main entry point, but the rest of the PR contains changes that all go together. The problem I'm trying to solve with this PR is that right now, we have repeated lines of code for the same operation, causing us to iterate through the data multiple times. What I'm attempting to do here is instead simplify this by introducing one function to iterate through the data and determine the parameters needed, which is then passed to another function that performs the check and logs any discrepancies. While adding these new functions and replacing the old, I'm also describing them in JSDoc to give a more complete PR so we don't have to bother following up later. Basically, all of the changes between lines 9 and 101, along with lines 110 through 125 (all on the "before" side) are all related and can't be cherry-picked, at least not in a sensible way. The changes on other lines were included because they're so small on their own, they don't really warrant a separate PR, and we're already here working on this file. |
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.
LGTM, just some nits.
Co-authored-by: Claas Augner <github@caugner.de>
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.
One last follow-up nit, but still looking good, of course.
This pull request has merge conflicts that must be resolved before we can merge this. |
Co-authored-by: Claas Augner <github@caugner.de>
Now that the descriptions linter has been merged (yay!), I'm opening up this PR to consolidate the code a little bit. Essentially, this PR consolidates the four functions testing for each type of description into a single function, which calls out to another function that performs both the check and the logger output based upon a set of arguments. This is to help keep the number of code lines to a minimum, and reduce the number of iterations through data the linter must perform.
I'm open to suggestions or revisions!