https://github.com/xenia-foxtrot/flake8-rewriter
A flake8 plugin that rewrites error codes
https://github.com/xenia-foxtrot/flake8-rewriter
flake8 flake8-plugin python
Last synced: 3 months ago
JSON representation
A flake8 plugin that rewrites error codes
- Host: GitHub
- URL: https://github.com/xenia-foxtrot/flake8-rewriter
- Owner: xenia-foxtrot
- License: mit
- Created: 2019-02-09T01:45:14.000Z (over 7 years ago)
- Default Branch: master
- Last Pushed: 2019-02-10T03:04:13.000Z (over 7 years ago)
- Last Synced: 2026-01-14T10:18:30.899Z (5 months ago)
- Topics: flake8, flake8-plugin, python
- Language: Python
- Size: 23.4 KB
- Stars: 0
- Watchers: 0
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
A flake8 plugin that rewrites error codes.
# Usage
Install using `pip`:
```
$ pip install flake8-rewriter
```
## With `format`
To activate the plugin, set the format option to "rewriter". Then pass in `--replace=:` for each code you want replaced. In this syntax, `` will be replaced with ``.
The following will turn all "line longer than length" errors to warnings.
```
$ flake8 --format=rewriter --replace=E501:W501
```
## With `force-rewriter`
In some cases, you may want to use a custom format string, or are unable to modify the `--format` option (such as within an IDE). Thus, the `--force-rewriter` option was implemented to handle these cases. If `--format` specifies a format string, then the plugin will output using that string.
The following does the same as above, but also changes the output formatting.
```
$ flake8 --force-rewriter --format='%(row)d,%(col)d,%(code).1s,%(code)s:%(text)s' --replace=E501:W501
```
# Changelong
```
v1.2.0:
- --force-rewriter option is no longer fails to work if a --format option is placed after it.
v1.1.0:
- Added --force-rewriter option
- With --force-rewriter specified, flake8-rewriter now respects format strings specified through --format
```