Skip to content

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

Closed
khumba wants to merge 1 commit intoNixOS:masterfrom
khumba:skip-lint-silently
Closed

nixos/python-test-driver: add option to disable the linter without warning#96515
khumba wants to merge 1 commit intoNixOS:masterfrom
khumba:skip-lint-silently

Conversation

@khumba
Copy link
Copy Markdown
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 Issues or PRs affecting NixOS modules, or package usability issues specific to NixOS label Aug 28, 2020
@khumba khumba requested review from aszlig and worldofpeace August 28, 2020 02:23
@ofborg ofborg bot added 10.rebuild-darwin: 0 This PR does not cause any packages to rebuild on Darwin. 10.rebuild-linux: 0 This PR does not cause any packages to rebuild on Linux. labels Aug 28, 2020
Copy link
Copy Markdown
Member

@flokli flokli left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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
Copy Markdown
Contributor

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
Copy Markdown
Contributor Author

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 skip-lint-silently branch September 4, 2020 00:46
@flokli
Copy link
Copy Markdown
Member

flokli commented Sep 4, 2020 via email

@khumba
Copy link
Copy Markdown
Contributor Author

khumba commented Sep 5, 2020 via email

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

6.topic: nixos Issues or PRs affecting NixOS modules, or package usability issues specific to NixOS 10.rebuild-darwin: 0 This PR does not cause any packages to rebuild on Darwin. 10.rebuild-linux: 0 This PR does not cause any packages to rebuild on Linux.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants