question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Only show violated rules when target version is given

See original GitHub issue

When the --target argument is given, we expect vermin to work more like a linter: it has a predefined goal, matches some rules and report violations (and set exit code to 0 or 1 accordingly). Typically linters emit as few output lines as possible when there is no violation found, and only display violated rules when found. This helps users spot rule violations more easily, compare this:

$ python3 vermin.py -t=2.7 -t=3.0 --format parsable .
/path/to/vermin/misc/travis/after_success.sh:4:7: error: invalid syntax: if [[ $TRAVIS_PYTHON_VERSION != 2.7 && $TRAVIS_PYTHON_VERSION != 3.4 ]]; then
/path/to/vermin/misc/travis/script.sh:4:7: error: invalid syntax: if [[ $TRAVIS_PYTHON_VERSION = 2.7 || $TRAVIS_PYTHON_VERSION = 3.4 ]]; then
(many lines omitted ...)
/path/to/vermin/runtests.py:8::2.7:3.1:'unittest.main(exit)'
/path/to/vermin/runtests.py:::2.7:3.1:
(many lines omitted ...)
:::2.7:3.1:

with this:

$ python3 vermin.py -t=2.7 -t=3.0 --format parsable .
/path/to/vermin/runtests.py:8::2.7:3.1:'unittest.main(exit)'
/path/to/vermin/runtests.py:::2.7:3.1:
:::2.7:3.1:

We can either:

  • Add a flag like --only-show-violated (maybe a shorter name) to do this, this flag only makes sense when --target is given
  • Make this behavior to be the default when --target is given (this is backwards incompatible behavior change)

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Comments:19 (19 by maintainers)

github_iconTop GitHub Comments

1reaction
gousaiyangcommented, Apr 27, 2021

I’ve tested this against some of my projects and I think the current implementation is pretty good.

1reaction
gousaiyangcommented, Oct 23, 2020

-X is probably a bit weird since it usually means “eXtension” or “eXtra” or “eXecute”.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Target Corporation Code of Ethics
Watch for potential violations of our. Code, our policies or any laws and voice your concerns immediately. Live Target values. Make sure every...
Read more >
Troubleshooting Amazon EventBridge - AWS Documentation
How can I tell when EventBridge rules are broken? You can use the following alarm to notify you when your EventBridge rules are...
Read more >
Behavior changes: Apps targeting Android 12
Learn about changes in Android 12 that will affect apps when they target Android 12.
Read more >
Suppress code analysis violations - Visual Studio (Windows)
The Error List displays diagnostics, or rule violations, from both live code analysis and build.
Read more >
My Android app is not working properly once I set targetSDK ...
Use this flexibility as you prepare to target the latest stable API version and as you test your app with the preview release...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found