4 ms·
Ask HN: How to efficiently review a pull request that is full of linter changes?
A lot of the changes are just lines have been reordered and within context, this isn't useful to me.
Any tips to review a large pull request consisting of 1k lines changed all due to a new linter being applied.
- lantry 4y agotldr: don't review linter changes Run the new linter on all the files. Don't make any other changes. Spot check a few places to make sure the linter doesn't majorly mess anything up. Make sure your automated tests still pass. Merge this change without reviewing every single line. Now that all your files are "clean", continue making changes and reviewing them like normal.
- gus_massa 4y agoIt's a public repo or a PR inside the company where you work? Anyway, the solution is to ask nicely that the author rewrites the PR with the relevant changes, and then make another PR with the new linter. (Which linter to use, is a project-wide decision. Who is in charge of this?)
- zikohh 4y agoI'd like to add the most linters change things like line length and so on. However, this linter is changing the order of keys and values in a go struct (which I'd already formatted with go fmt), which makes it much harder to review than your typical line length change.
- gus_massa 4y ago> this linter is changing the order of keys and values in a go struct Is this a good idea?!?! I don't know golang. Can you show an example where this change is useful? (Or a link to a webpage that explains this change.) [Sorry for the side question, but I'm curious.]
- zikohh 4y agohttps://pastebin.com/Cdif0t5v https://pastebin.com/Cdif0t5v It changes the initialisation order - it's not a problem but hard to review.
- zikohh 4y agoOh wait useful ?! I don't think ordering structs alphabetically is useful I agree that if it's not useful it shouldn't be done and transitively that makes the pull request easier to review. But still a very indirect approach
- gus_massa 4y agoCan it be disabled with an option? If I have an structure with mass, height and width, I'll really hate to order them as height, mass and width. My totally uninformed opinion is to run away from a linter that makes that changes.
- KolenCh 4y agoIf there's a recipe to produce the change, ask for the recipe instead (and better yet, put it in the commit.) Then if you can reproduce that PR, and tests are passing, skim through it and see if nothing funny. Then it should be good to go.