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.

Support adding exceptions through argument | --add-exceptions

See original GitHub issue

Compatibility section in docs states:

FlakeHeaven supports all flake8 plugins, formatters, and configs. However, FlakeHeaven has it’s own beautiful way to configure enabled plugins and codes. So, options like --ignore and --select unsupported.

Problem

I use flakeheaven as a linter in VSCode and some errors overlap with pylance or mypy, resulting in repeated errors and requiring more attention than it should. So ignoring overlapping errors makes sense.

However, I still want to see them when I execute flakeheaven manually, since I’m not using pyright manually.

Suggestion

It would be great to have option like --add-exceptions, which then could be used like this:

    "python.linting.flake8Path": "${workspaceFolder}/.venv/bin/flake8heavened",
    "python.linting.flake8Args": ["--add-exceptions=-F821,-F401"],

What do you think?

I can make a PR implementing it, but want to listen to your opinions/suggestions on that first.

Issue Analytics

  • State:closed
  • Created a year ago
  • Reactions:1
  • Comments:8

github_iconTop GitHub Comments

2reactions
pwoolvettcommented, May 16, 2022

Hi @Bobronium

did you try something like this:

    "python.linting.flake8Args": ["--config", ".vscode/flakeheaven.toml"],
#.vscode/flakeheaven.toml
[tool.flakeheaven]
base = "pyproject.toml"

[tool.flakeheaven.plugins]
pyflakes = ["+*", "-F821", "-F401"]

If so, did you encounter any issues with this approach?

EDIT:

I tried it (mian branch) with flakeheaven lint --config .vscode/flakeheaven.toml example.py and flake8heavened --config .vscode/flakeheaven.toml example.py. Both work

1reaction
Bobroniumcommented, May 16, 2022

I’ve patched sources myself to fix --config argument and can confirm that it works, thank you.

Waiting for #80 to be resolved then.

I’ll leave issue opened for a while, since --add-exceptions still would be nice to have.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Adding Exceptions to the Windows Firewall
Double-click Windows Firewall to open the Windows Firewall window. Click the Exceptions tab. Click the Add Port button. Enter a name in the...
Read more >
Rule exceptions and value lists | Elastic Security Solution [8.5]
In the Value lists table, click the required action button. Import value list flyout with action buttons highlighted. Add exceptions to a ruleedit....
Read more >
How to add an exception to Windows Defender
Thanks for contacting our support. 1. Go to Start > Settings > Update & Security > Windows Security > Virus & threat protection....
Read more >
What's new for Java 7 - Eclipse
The new Add exceptions to existing catch clause quick fix allows you to add uncaught exceptions to an existing catch clause. Add exceptions...
Read more >
Built-in Exceptions — Python 3.11.1 documentation
In Python, all exceptions must be instances of a class that derives from BaseException ... Also, the filename2 constructor argument and attribute was...
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