Zulip Chat Archive

Stream: new members

Topic: Probable misformatting of curly braces


Sebastian Monnet (Feb 02 2022 at 16:13):

The linter on my PR (#11780) says Warning: WRN_BRC: Probable misformatting of curly braces three times and then finishes with Error: Process completed with exit code 123.. I'm not sure how to fix this error, since I don't know where in the code the problem is. I suspect I'm missing something obvious. Can anyone help?

Eric Rodriguez (Feb 02 2022 at 16:29):

mathlib brace style is like this:

begin
  my_tactic_that_splits_things,
  { tactic1,
    tactic2,
    tactic3 },
  { tactic1 }
end

edit: ignore my lack of indents, Yaël is right!

Anne Baanen (Feb 02 2022 at 16:34):

Unfortunately, GitHub filters out the actual location of the error. You can see the errors if you click on the files changed tab, for example src/field_theory/krull_topology.lean line 138

Yaël Dillies (Feb 02 2022 at 16:48):

Eric Rodriguez said:

mathlib brace style is like this:

begin
my_tactic_that_splits_things,
{ tactic1,
  tactic2,
  tactic3 },
{ tactic1 }
end

begin
  my_tactic_that_splits_things,
  { tactic1,
    tactic2,
    tactic3 },
  { tactic1 }
end

actually

Daniel Roca González (Feb 02 2022 at 17:23):

One more thing: you can use the #lint command to make sure you have everything in order before pushing: that way you don't have to wait for GitHub to process your PR.

Yaël Dillies (Feb 02 2022 at 17:32):

Not quite, Daniel. #lint only runs the code linters, not the style ones.

Yaël Dillies (Feb 02 2022 at 17:33):

But, yes, do run #lint and Ctrl+F .{101} (for long lines) before pushing anything to Github.

Eric Rodriguez (Feb 02 2022 at 17:45):

You can turn on editor rulers on VSCode, Yaël, if youwant to make things a bit easier ^^

Yaël Dillies (Feb 02 2022 at 17:59):

I do! But the font is not quite monospace, and staring at the line ends of a 500 lines file is so much longer than Ctrl+F ing six characters.

Eric Wieser (Feb 02 2022 at 21:51):

Yeah, font issues make the rulers pretty useless sadly.

Eric Rodriguez (Feb 02 2022 at 22:10):

for me they've worked pretty flawlessly - but tbf I use a weird font in Cascadia Code

Anne Baanen (Feb 03 2022 at 11:10):

:set colorcolumn=100 works beautifully for me in nvim :)


Last updated: Dec 20 2023 at 11:08 UTC