Muestra las diferencias entre dos versiones de la página.
| Próxima revisión | Revisión previa | ||
|
wiki2:python:flake8 [2019/03/18 08:14] alfred creado |
wiki2:python:flake8 [2020/05/09 09:25] (actual) |
||
|---|---|---|---|
| Línea 27: | Línea 27: | ||
| The output format is: \\ | The output format is: \\ | ||
| ''file path : line number : column number : error code : short description'' | ''file path : line number : column number : error code : short description'' | ||
| + | |||
| + | Flake8 will exit with code 1 if there are errors. You can change this using the parameter: ''<nowiki>--exit-zero</nowiki>'' | ||
| Error code prefix: | Error code prefix: | ||
| Línea 68: | Línea 70: | ||
| * Visual Studio Code | * Visual Studio Code | ||
| * https://code.visualstudio.com/docs/python/linting | * https://code.visualstudio.com/docs/python/linting | ||
| + | |||
| + | ==== Interesting usages ==== | ||
| + | Parameters: | ||
| + | * ''<nowiki>--count</nowiki>'' to print the number of errors. | ||
| + | * ''<nowiki>--select=E4,E51,W234</nowiki>'' to select which errors analyse. | ||
| + | * ''<nowiki>--ignore=E4,E51,W234</nowiki>'' to select which errors ignore. | ||
| + | * ''<nowiki>--show-source</nowiki>'' to show the code where the error was found. | ||
| + | * ''<nowiki>--output-file=OUTPUT_FILE</nowiki>'' to redirect the output to a text file. | ||
| + | * ''<nowiki>--config=CONFIG</nowiki>'' to select the config file. | ||
| + | * ''<nowiki>--statistics</nowiki>'' to show statistics about errors and warnings. | ||
| + | |||
| + | === Using hooks for version control === | ||
| + | |||
| + | http://flake8.pycqa.org/en/latest/user/using-hooks.html | ||
| + | |||
| + | You can stop a commit if flake8 find errors. | ||
| + | |||
| + | |||
| + | ==== Plugins ==== | ||
| + | |||
| + | To see which plugins are enabled: | ||
| + | <code> | ||
| + | flake8 --version | ||
| + | </code> | ||
| + | |||
| + | To temporally enable disabled plugins: ''<nowiki>--enabled-extensions=ENABLED_EXTENSIONS</nowiki>''. | ||
| + | |||