1
0
mirror of https://gitlab.com/fdroid/fdroidserver.git synced 2024-09-17 10:40:12 +02:00

Merge branch 'vscode' into 'master'

add vscode settings

Closes #909

See merge request fdroid/fdroidserver!965
This commit is contained in:
Hans-Christoph Steiner 2021-06-18 06:51:30 +00:00
commit 1236f89896
6 changed files with 38 additions and 5 deletions

3
.bandit Normal file
View File

@ -0,0 +1,3 @@
[bandit]
skips: B110,B404,B408,B410,B603,B607
targets: .

View File

@ -181,9 +181,9 @@ lint_format_safety_bandit_checks:
- function set_error() { export EXITVALUE=1; printf "\x1b[31mERROR `history|tail -2|head -1|cut -b 6-500`\x1b[0m\n"; } - function set_error() { export EXITVALUE=1; printf "\x1b[31mERROR `history|tail -2|head -1|cut -b 6-500`\x1b[0m\n"; }
- ./hooks/pre-commit || set_error - ./hooks/pre-commit || set_error
- bandit - bandit
-r
-ii -ii
-s B110,B404,B408,B410,B603,B607 --ini .bandit
-r $CI_PROJECT_DIR fdroid
|| set_error || set_error
- safety check --full-report || set_error - safety check --full-report || set_error
- pylint --rcfile=.pylint-rcfile --output-format=colorized --reports=n - pylint --rcfile=.pylint-rcfile --output-format=colorized --reports=n
@ -213,8 +213,7 @@ lint_mypy:
python3-pip python3-pip
python3-wheel python3-wheel
- pip install -e .[test] - pip install -e .[test]
# exclude vendored file - mypy
- mypy --exclude fdroidserver/apksigcopier.py
fedora_latest: fedora_latest:

5
.vscode/extensions.json vendored Normal file
View File

@ -0,0 +1,5 @@
{
"recommendations": [
"ms-python.python",
]
}

22
.vscode/settings.json vendored Normal file
View File

@ -0,0 +1,22 @@
{
"python.formatting.blackArgs": [
"--config pyproject.toml"
],
"python.formatting.provider": "black",
"python.linting.banditEnabled": true,
"python.linting.banditArgs": [
"-r",
"-ii",
"--ini .bandit",
],
"python.linting.enabled": true,
"python.linting.mypyArgs": [
"--config-file mypy.ini"
],
"python.linting.mypyEnabled": true,
"python.linting.pycodestyleEnabled": true,
"python.linting.pylintArgs": [
"--rcfile=.pylint-rcfile"
],
"python.linting.pylintEnabled": true,
}

View File

@ -1,5 +1,7 @@
[mypy] [mypy]
files = fdroidserver files = fdroidserver
# exclude vendored file
exclude = fdroidserver/apksigcopier.py
# this is de-facto the linter setting for this file # this is de-facto the linter setting for this file
warn_unused_configs = True warn_unused_configs = True
@ -12,4 +14,4 @@ ignore_missing_imports = True
# unfortunately both tools expect their ignore flag as a comment in the same line # unfortunately both tools expect their ignore flag as a comment in the same line
# [misc] is ignored for the "incompatible import" # [misc] is ignored for the "incompatible import"
# [arg-type] is ignored because when there are missing envs, everything will crash, not just the types # [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 disable_error_code = no-redef, misc, arg-type

2
pyproject.toml Normal file
View File

@ -0,0 +1,2 @@
[tool.black]
skip-string-normalization = true