flake8 ¤
Callable for Flake8.
Functions:
-
run
–Run
flake8
.
run ¤
run(
*paths: str,
config: str | None = None,
verbose: bool | None = None,
output_file: str | None = None,
append_config: str | None = None,
isolated: bool | None = None,
enable_extensions: list[str] | None = None,
require_plugins: list[str] | None = None,
quiet: bool | None = None,
color: Literal["auto", "always", "never"] | None = None,
count: bool | None = None,
exclude: list[str] | None = None,
extend_exclude: list[str] | None = None,
filename: list[str] | None = None,
stdin_display_name: str | None = None,
error_format: str | None = None,
hang_closing: bool | None = None,
ignore: list[str] | None = None,
extend_ignore: list[str] | None = None,
per_file_ignores: dict[str, list[str]] | None = None,
max_line_length: int | None = None,
max_doc_length: int | None = None,
indent_size: int | None = None,
select: list[str] | None = None,
extend_select: list[str] | None = None,
disable_noqa: bool | None = None,
show_source: bool | None = None,
no_show_source: bool | None = None,
statistics: bool | None = None,
exit_zero: bool | None = None,
jobs: int | None = None,
tee: bool | None = None,
benchmark: bool | None = None,
bug_report: bool | None = None
) -> int
Run flake8
.
Parameters:
-
*paths
(str
, default:()
) –Paths to check.
-
config
(str | None
, default:None
) –Path to the config file that will be the authoritative config source. This will cause Flake8 to ignore all other configuration files.
-
verbose
(bool | None
, default:None
) –Print more information about what is happening in flake8. This option is repeatable and will increase verbosity each time it is repeated.
-
output_file
(str | None
, default:None
) –Redirect report to a file.
-
append_config
(str | None
, default:None
) –Provide extra config files to parse in addition to the files found by Flake8 by default. These files are the last ones read and so they take the highest precedence when multiple files provide the same option.
-
isolated
(bool | None
, default:None
) –Ignore all configuration files.
-
enable_extensions
(list[str] | None
, default:None
) –Enable plugins and extensions that are otherwise disabled by default.
-
require_plugins
(list[str] | None
, default:None
) –Require specific plugins to be installed before running.
-
quiet
(bool | None
, default:None
) –Report only file names, or nothing. This option is repeatable.
-
color
(Literal['auto', 'always', 'never'] | None
, default:None
) –Whether to use color in output. Defaults to
auto
. -
count
(bool | None
, default:None
) –Print total number of errors to standard output and set the exit code to 1 if total is not empty.
-
exclude
(list[str] | None
, default:None
) –Comma-separated list of files or directories to exclude (default: ['.svn', 'CVS', '.bzr', '.hg', '.git', 'pycache', '.tox', '.nox', '.eggs', '*.egg']).
-
extend_exclude
(list[str] | None
, default:None
) –Comma-separated list of files or directories to add to the list of excluded ones.
-
filename
(list[str] | None
, default:None
) –Only check for filenames matching the patterns in this comma-separated list (default: ['*.py']).
-
stdin_display_name
(str | None
, default:None
) –The name used when reporting errors from code passed via stdin. This is useful for editors piping the file contents to flake8 (default: stdin).
-
error_format
(str | None
, default:None
) –Format errors according to the chosen formatter.
-
hang_closing
(bool | None
, default:None
) –Hang closing bracket instead of matching indentation of opening bracket's line.
-
ignore
(list[str] | None
, default:None
) –Comma-separated list of error codes to ignore (or skip). For example,
--ignore=E4,E51,W234
(default: E121,E123,E126,E226,E24,E704,W503,W504). -
extend_ignore
(list[str] | None
, default:None
) –Comma-separated list of error codes to add to the list of ignored ones. For example,
--extend-ignore=E4,E51,W234
. -
per_file_ignores
(dict[str, list[str]] | None
, default:None
) –A pairing of filenames and violation codes that defines which violations to ignore in a particular file. The filenames can be specified in a manner similar to the
--exclude
option and the violations work similarly to the--ignore
and--select
options. -
max_line_length
(int | None
, default:None
) –Maximum allowed line length for the entirety of this run (default: 79).
-
max_doc_length
(int | None
, default:None
) –Maximum allowed doc line length for the entirety of this run (default: None).
-
indent_size
(int | None
, default:None
) –Number of spaces used for indentation (default: 4).
-
select
(list[str] | None
, default:None
) –Comma-separated list of error codes to enable. For example,
--select=E4,E51,W234
(default: E,F,W,C90). -
extend_select
(list[str] | None
, default:None
) –Comma-separated list of error codes to add to the list of selected ones. For example,
--extend-select=E4,E51,W234
. -
disable_noqa
(bool | None
, default:None
) –Disable the effect of "# noqa". This will report errors on lines with "# noqa" at the end.
-
show_source
(bool | None
, default:None
) –Show the source generate each error or warning.
-
no_show_source
(bool | None
, default:None
) –Negate --show-source.
-
statistics
(bool | None
, default:None
) –Count errors.
-
exit_zero
(bool | None
, default:None
) –Exit with status code "0" even if there are errors.
-
jobs
(int | None
, default:None
) –Number of subprocesses to use to run checks in parallel. This is ignored on Windows. The default, "auto", will auto-detect the number of processors available to use (default: auto).
-
tee
(bool | None
, default:None
) –Write to stdout and output-file.
-
benchmark
(bool | None
, default:None
) –Print benchmark information about this run of Flake8.
-
bug_report
(bool | None
, default:None
) –Print information necessary when preparing a bug report.
Returns:
-
int
–Success/failure.
Source code in src/duty/callables/flake8.py
11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 |
|