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

nixos/python-test-driver: add option to disable the linter without warning #96515

Closed
wants to merge 1 commit into from

Conversation

@khumba
Copy link
Contributor

@khumba khumba commented Aug 28, 2020

Motivation for this change

This is to partially address #72964.

This follows up from #76171 to add a way to disable the linter for
NixOS tests using the Python driver, without printing a warning to the
console, as skipLint does. Linting is skipped if either skipLint or
the new skipLintSilently option are true, but a warning about skipping
is only printed if skipLintSilently is false.

This is meant to allow running tests during development, or outside of
Nixpkgs, without forcing unnecessary work to conform to a style guide
when it's not relevant.

skipLintSilently is not meant to be used for merged to Nixpkgs main,
non-feature branches.

I'm open to combining these two parameters or having some other way
to pass them in, I more just want a way to turn off a stream of

trace: warning: Linting is disabled!
trace: warning: Linting is disabled!
trace: warning: Linting is disabled!
...

messages I see when building a bunch of tests with linting disabled.

Things done
  • Tested using sandboxing (nix.useSandbox on NixOS, or option sandbox in nix.conf on non-NixOS linux)
  • Built on platform(s)
    • NixOS
    • macOS
    • other Linux distributions
  • Tested via one or more NixOS test(s) if existing and applicable for the change (look inside nixos/tests)
  • Tested compilation of all pkgs that depend on this change using nix-shell -p nixpkgs-review --run "nixpkgs-review wip"
  • Tested execution of all binary files (usually in ./result/bin/)
  • Determined the impact on package closure size (by running nix path-info -S before and after)
  • Ensured that relevant documentation is up to date
  • Fits CONTRIBUTING.md.
…rning

This follows up from nixpkgs#76171 to add a way to disable the linter for
NixOS tests using the Python driver, without printing a warning to the
console, as `skipLint` does.  Linting is skipped if either `skipLint` or
the new `skipLintSilently` option are true, but a warning about skipping
is only printed if `skipLintSilently` is false.

This is meant to allow running tests during development, or outside of
Nixpkgs, without forcing unnecessary work to conform to a style guide
when it's not relevant.
@ofborg ofborg bot added the 6.topic: nixos label Aug 28, 2020
@khumba khumba mentioned this pull request Aug 28, 2020
3 of 10 tasks complete
@khumba khumba requested review from worldofpeace and aszlig Aug 28, 2020
Copy link
Contributor

@flokli flokli left a comment

I'm not sure adding yet another option to disable linting entirely is the right way to approach this, and would rather prefer if we'd have a discussion about how/what linting we want to have in #72964.

@worldofpeace
Copy link
Member

@worldofpeace worldofpeace commented Aug 28, 2020

I'm not sure adding yet another option to disable linting entirely is the right way to approach this, and would rather prefer if we'd have a discussion about how/what linting we want to have in #72964.

I would agree with that

@khumba
Copy link
Contributor Author

@khumba khumba commented Sep 4, 2020

Closing as this isn't needed, Black already offers a way with # fmt: off.

@khumba khumba closed this Sep 4, 2020
@khumba khumba deleted the khumba:skip-lint-silently branch Sep 4, 2020
@flokli
Copy link
Contributor

@flokli flokli commented Sep 4, 2020

@khumba
Copy link
Contributor Author

@khumba khumba commented Sep 5, 2020

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked issues

Successfully merging this pull request may close these issues.

None yet

3 participants
You can’t perform that action at this time.