This is an archive of the discontinued Mercurial Phabricator instance.

style: never put multiple statements on one line
ClosedPublic

Authored by alex_gaynor on Oct 2 2017, 9:01 AM.

Diff Detail

Repository
rHG Mercurial
Lint
Automatic diff as part of commit; lint not applicable.
Unit
Automatic diff as part of commit; unit tests not applicable.

Event Timeline

alex_gaynor created this revision.Oct 2 2017, 9:01 AM
ryanmce accepted this revision.Oct 2 2017, 1:17 PM
ryanmce added a subscriber: ryanmce.

This seems like a straightforward win.

Is there any way we can add a check-code for this if we don't already have one?

This, and the other style things I've sent PRs for, were discovered with flake8 --select=E714,E701,E203 mercurial/.

If the Style Czar or Style Committee agree with this change, could we add pylint check? The msg id for these errors is "multiple-statements (C0321)"

indygreg accepted this revision.

Since you weren't at the Sprint, I think the decision for style is that we'd check the existing wiki page for the style guide into the repo (possibly along with profiles/configs for various linting/reformatting tools). Then, future changes to style would be handled via code review.

@sid0's annotation revision skipping feature is maturing and combined with @yuya's patches to resolve a revset from a file will allow us to check in a file containing a list of "reformatting" revisions to automatically/easily skip when doing annotate. So we should be more willing to mass rewrite code.

This revision is now accepted and ready to land.Oct 2 2017, 1:25 PM
This revision was automatically updated to reflect the committed changes.