1
0
mirror of https://gitlab.com/fdroid/fdroidserver.git synced 2024-11-04 22:40:12 +01:00
fdroidserver/pyproject.toml
Hans-Christoph Steiner 497fcfc848 silence new pylint checks that are too much for the current state
Ideally, these would be fixed.  But it'll be a project.

* C0201: Consider iterating the dictionary directly instead of calling .keys() (consider-iterating-dictionary)
* R1705: Unnecessary "else" after "return", remove the "else" and de-indent the code inside it (no-else-return)
* R1720: Unnecessary "elif" after "raise", remove the leading "el" from "elif" (no-else-raise)
* R1720: Unnecessary "else" after "raise", remove the "else" and de-indent the code inside it (no-else-raise)
* R1722: Consider using 'sys.exit' instead (consider-using-sys-exit)
* R1723: Unnecessary "elif" after "break", remove the leading "el" from "elif" (no-else-break)
* R1724: Unnecessary "elif" after "continue", remove the leading "el" from "elif" (no-else-continue)
* R1735: Consider using '{}' instead of a call to 'dict'. (use-dict-literal)
* W0133: Exception statement has no effect (pointless-exception-statement)
* W0718: Catching too general exception Exception (broad-exception-caught)
* W0719: Raising too general exception: Exception (broad-exception-raised)
* W1510: 'subprocess.run' used without explicitly defining the value for 'check'. (subprocess-run-check)
2023-02-02 16:13:54 +01:00

85 lines
2.9 KiB
TOML

[tool.black]
skip-string-normalization = true
target-version = ["py38"]
[tool.mypy]
python_version = "3.9"
files = "fdroidserver"
# exclude vendored file
exclude = "fdroidserver/apksigcopier.py"
# this is de-facto the linter setting for this file
warn_unused_configs = true
# TODO: we should either upgrade the used packages to a version which includes type hints OR install/write stub packages for these libraries.
# Further details here: https://mypy.readthedocs.io/en/stable/running_mypy.html#missing-type-hints-for-third-party-library
ignore_missing_imports = true
# ignore the [no-redef] errors, as they collide with the bandit "# nosec" exclusion (common.py)
# unfortunately both tools expect their ignore flag as a comment in the same line
# [misc] is ignored for the "incompatible import"
# [arg-type] is ignored because when there are missing envs, everything will crash, not just the types
disable_error_code = "no-redef, misc, arg-type"
[tool.pylint.main]
# Use multiple processes to speed up Pylint. Specifying 0 will auto-detect the
# number of processors available to use, and will cap the count on Windows to
# avoid hangs.
jobs = 4
[tool.pylint.basic]
# Good variable names which should always be accepted, separated by a comma.
good-names = ["i", "j", "k", "ex", "Run", "f", "fp"]
[tool.pylint."messages control"]
# Only show warnings with the listed confidence levels. Leave empty to show all.
# Valid levels: HIGH, CONTROL_FLOW, INFERENCE, INFERENCE_FAILURE, UNDEFINED.
confidence = ["HIGH", "INFERENCE"]
# Disable the message, report, category or checker with the given id(s). You can
# either give multiple identifiers separated by comma (,) or put this option
# multiple times (only on the command line, not in the configuration file where
# it should appear only once). You can also use "--disable=all" to disable
# everything first and then re-enable specific checks. For example, if you want
# to run only the similarities checker, you can use "--disable=all
# --enable=similarities". If you want to run only the classes checker, but have
# no Warning level messages displayed, use "--disable=all --enable=classes
# --disable=W".
# TODO many of these could be fixed if someone wants to spend the time
disable = [
"broad-exception-caught",
"broad-exception-raised",
"consider-iterating-dictionary",
"consider-using-sys-exit",
"invalid-name",
"missing-class-docstring",
"missing-function-docstring",
"missing-module-docstring",
"no-else-break",
"no-else-continue",
"no-else-raise",
"no-else-return",
"no-member",
"pointless-exception-statement",
"subprocess-run-check",
"use-dict-literal",
]
[tool.pylint.miscellaneous]
# List of note tags to take in consideration, separated by a comma.
notes = ["FIXME", "XXX", "TODO"]
[tool.pylint.refactoring]
# Maximum number of nested blocks for function / method body
max-nested-blocks = 5
[tool.pylint.format]
# Maximum number of characters on a single line.
max-line-length = 88