Skip to content
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

ci: Enforce that styleCheck produces no output #16

Closed
ErikSchierboom opened this issue Oct 8, 2020 · 1 comment · Fixed by #706
Closed

ci: Enforce that styleCheck produces no output #16

ErikSchierboom opened this issue Oct 8, 2020 · 1 comment · Fixed by #706
Labels

Comments

@ErikSchierboom
Copy link
Member

No description provided.

ee7 added a commit that referenced this issue Feb 2, 2021
This allows us to see styleCheck output if `--verbose` is passed during
`nimble build`. 

The `--verbose` is required because the latest release of Nimble
(0.12.0, in Oct 2020) adds `--hints:off` by default, and that's set
after `--hint[Name]:on` can be passed.

From the Nimble changelog:
> Calls to the Nim compiler now display --hints:off output by default.
> The --verbose flag will print the full Nim command as well as regular
> compiler output.

However, this commit is also useful to turn on styleCheck by default for
a user who runs `nim c foo.nim` in our project. 

`--styleCheck:error` is possible too, but it's currently too aggressive:
it would currently produce an error if one of our Nimble dependencies
has a style problem.

See: #16
@ee7 ee7 changed the title Add stylecheck to build ci: Add stylecheck May 9, 2021
@ee7 ee7 changed the title ci: Add stylecheck ci: Enforce that styleCheck produces no output May 9, 2021
@ee7
Copy link
Member

ee7 commented May 9, 2021

--styleCheck:error is currently too inconvenient.

But the development version of Nim has a new command-line option that allows turning a hint into an error. So one way to resolve this issue is to wait until Nim 1.6.0 and then use --hintAsError[Name]:on to get the best of both worlds.

See #305.

@ee7 ee7 added the kind: ci label May 10, 2021
@ee7 ee7 closed this as completed in #706 Dec 2, 2022
ee7 added a commit that referenced this issue Dec 2, 2022
We needed commit 927ad80 ("ci: use `--styleCheck:hint`, not
`--styleCheck:error`", 2021-05-03) because `nimble build` would previously
error for a styleCheck problem in a Nimble package that we import.
However, from Nim 1.6.8 (2022-09-27) onwards, styleCheck only applies
to the current package [1].

So let's turn styleCheck problems into errors again, which now just
means that `nimble build` errors if code in the configlet repo either:

- Declares an identifier using a style that violates the first point in
  the NEP-1 naming conventions [2]

- Refers to an identifier using a style that is different to the
  declaration style.

[1] nim-lang/Nim@c484943cab39
[2] https://github.com/nim-lang/Nim/blob/e03a178bff6b/doc/nep1.md#naming-conventions

Closes: #16
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants