-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add compatibility with VS Code October 2023
The October 2023 version of VS Code deprecates built-in linting and formatting features that were shipped with the Python extension. This means linters and formatters will have to run through dedicated extensions. There are currently extensions for Black, Pylint and Flake8, but there are no extensions for Bandit and Pydocstyle. This means they must be run in another way. Luckily there are Flake8 plugins for both Bandit and Pydocstyle. With the changes in this commit, Voight-Kampff now expects the user to use the plugins if they want to run Bandit and Pydocstyle, and consequently the standalone linters are disabled by default when running `vk`. It is still possible to run the linters by explicitly specifying their names as arguments to the `vk` command. Unfortunately, the Bandit Flake8 plugin expects a config file in INI format while Voight-Kampff originally expected a YAML config file for Bandit. For compatibility with the plugin, this commit updates Voight-Kampff to expect an INI file. This breaks backwards compatibility. Further, the functionality for disabling rules are different between the standalone Bandit and the Flake8-plugin. Consequently if, say, the rule that detects for hardcoded passwords is to be disabled inline, it must be done in one way to work with the standalone linter, and in another way to work with the Flake8 plugin. This means any code that disables Bandit rules inline should be updated. Pydocstyle does not suffer from this problem. The Voight-Kampff code itself has been updated to expect both plugins to be installed.
- Loading branch information
Showing
6 changed files
with
39 additions
and
42 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,2 @@ | ||
skips: | ||
- B101 # assert_used | ||
[bandit] | ||
skips = B101 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters