Skip to content

Commit 618aa44

Browse files
committed
Update package
1 parent 86285b1 commit 618aa44

6 files changed

+139
-15
lines changed

.vscode/extensions.json

+8-3
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,14 @@
11
{
22
"recommendations": [
33
"njpwerner.autodocstring",
4-
"vscode-icons-team.vscode-icons",
4+
"aaron-bond.better-comments",
5+
"streetsidesoftware.code-spell-checker",
6+
"discretegames.f5anything",
57
"mohsen1.prettify-json",
6-
"njqdev.vscode-python-typehint",
7-
"Gruntfuggly.todo-tree"
8+
"vscode-icons-team.vscode-icons",
9+
"foxundermoon.shell-format",
10+
"sanaajani.taskrunnercode",
11+
"gruntfuggly.todo-tree",
12+
"redhat.vscode-yaml"
813
]
914
}

.vscode/settings.json

+38-4
Original file line numberDiff line numberDiff line change
@@ -2,18 +2,23 @@
22
"debug.internalConsoleOptions": "neverOpen",
33
"python.terminal.activateEnvironment": true,
44
"python.defaultInterpreterPath": "/workspaces/app/.venv/bin/python",
5-
"python.linting.pylamaEnabled": true,
6-
"python.linting.pylamaPath": "/workspaces/app/.venv/bin/pylama",
5+
"python.linting.enabled": true,
6+
// "python.linting.pylamaEnabled": true,
7+
// "python.linting.pylamaPath": "/workspaces/app/.venv/bin/pylama",
78
"python.linting.mypyEnabled": true,
89
"python.linting.mypyPath": "/workspaces/app/.venv/bin/mypy",
910
"python.linting.mypyArgs": [],
1011
"python.linting.pylintEnabled": true,
1112
"python.linting.pylintPath": "/workspaces/app/.venv/bin/pylint",
1213
"python.linting.flake8Enabled": true,
1314
"python.linting.flake8Path": "/workspaces/app/.venv/bin/flake8",
14-
"python.linting.enabled": true,
1515
"python.formatting.provider": "yapf",
1616
"python.formatting.yapfPath": "/workspaces/app/.venv/bin/yapf",
17+
// "python.linting.flake8Enabled": false,
18+
// "python.linting.flake8Path": "/workspaces/app/.venv/bin/flake8",
19+
// "python.formatting.provider": "black",
20+
// "python.formatting.blackPath": "/workspaces/app/.venv/bin/black",
21+
// "editor.formatOnSaveMode": "file",
1722
"editor.formatOnSave": true,
1823
"files.trimTrailingWhitespace": true,
1924
"files.trimFinalNewlines": true,
@@ -22,7 +27,8 @@
2227
"files.exclude": {
2328
"**/__pycache__": true,
2429
"**/.mypy_cache": true,
25-
"**/.venv": true
30+
"**/.venv": true,
31+
"**/.pytest_cache": true
2632
},
2733
"python.analysis.typeCheckingMode": "strict",
2834
"python.analysis.importFormat": "absolute",
@@ -34,5 +40,33 @@
3440
"python.languageServer": "Pylance",
3541
"python.analysis.exclude": [
3642
"**/.venv"
43+
],
44+
"docwriter.style": "Google",
45+
"python.testing.pytestArgs": [
46+
"tests"
47+
],
48+
"python.testing.unittestEnabled": false,
49+
"python.testing.pytestEnabled": true,
50+
"python.createEnvironment.contentButton": "hide",
51+
"python.linting.maxNumberOfProblems": 50,
52+
"cSpell.words": [
53+
"dataframe",
54+
"dataframes",
55+
"dropna",
56+
"isin",
57+
"iterrows",
58+
"yapf"
59+
],
60+
"files.autoSaveDelay": 120000,
61+
"cSpell.maxDuplicateProblems": 2,
62+
"cSpell.maxNumberOfProblems": 25,
63+
"cSpell.ignorePaths": [
64+
"package-lock.json",
65+
"node_modules",
66+
"vscode-extension",
67+
".git/objects",
68+
".vscode",
69+
".vscode-insiders",
70+
".devcontainer"
3771
]
3872
}

.vscode/tasks.json

+27
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
{
2+
// See https://go.microsoft.com/fwlink/?LinkId=733558
3+
// for the documentation about the tasks.json format
4+
"version": "2.0.0",
5+
"tasks": [
6+
{
7+
"label": "All Python Packages: Install / Update",
8+
"type": "shell",
9+
"command": "${workspaceFolder}/tools/upgrade-all-python-package.sh",
10+
"problemMatcher": [],
11+
"group": {
12+
"kind": "none",
13+
"isDefault": true
14+
}
15+
},
16+
{
17+
"label": "CI/CD: Execute",
18+
"type": "shell",
19+
"command": "${workspaceFolder}/tools/execute-linters.sh",
20+
"problemMatcher": [],
21+
"group": {
22+
"kind": "test",
23+
"isDefault": true
24+
}
25+
}
26+
]
27+
}

requirements-dev.txt

+1
Original file line numberDiff line numberDiff line change
@@ -3,3 +3,4 @@ pylint
33
mypy
44
yapf
55
flake8
6+
# black

tools/execute-linters.sh

+47-8
Original file line numberDiff line numberDiff line change
@@ -1,25 +1,64 @@
11
#!/bin/bash
22

3+
source /workspaces/app/.venv/bin/activate
4+
sleep 0.5
5+
36
RED="\e[31m"
47
GREEN="\e[32m"
58
BLUE="\e[34m"
69
YELLOW="\e[33m"
10+
BOLD="\e[1m"
11+
712
ENDCOLOR="\e[0m"
813

9-
echo -e "\n${YELLOW}> Pylint.${ENDCOLOR}\n"
14+
echo -e "\n${YELLOW}> YAML Lint.${ENDCOLOR}"
15+
yamllint /workspaces/app/snow_revoke_privileges/
16+
17+
if [ "$?" -eq 0 ]; then
18+
echo -e "${GREEN}${BOLD}Success: no issues found${ENDCOLOR}"
19+
fi
20+
21+
echo -e "\n${YELLOW}> Pyright / Pylance.${ENDCOLOR}"
22+
result=$(pyright /workspaces/app/snow_revoke_privileges/)
23+
24+
if [ "$?" -eq 0 ]; then
25+
echo -e "${GREEN}${BOLD}Success: $result${ENDCOLOR}"
26+
else
27+
echo -e $result
28+
fi
29+
30+
echo -e "\n${YELLOW}> Pylint.${ENDCOLOR}"
31+
pylint /workspaces/app/snow_revoke_privileges/ --score=false --jobs=10
32+
33+
if [ "$?" -eq 0 ]; then
34+
echo -e "${GREEN}${BOLD}Success: no issues found${ENDCOLOR}"
35+
fi
36+
37+
echo -e "\n${YELLOW}> Flake8.${ENDCOLOR}"
38+
flake8 /workspaces/app/snow_revoke_privileges/
1039

11-
pylint my_project/
40+
if [ "$?" -eq 0 ]; then
41+
echo -e "${GREEN}${BOLD}Success: no issues found${ENDCOLOR}"
42+
fi
1243

13-
echo -e "\n${YELLOW}> Flake8.${ENDCOLOR}\n"
44+
echo -e "\n${YELLOW}> Mypy.${ENDCOLOR}"
45+
mypy /workspaces/app/snow_revoke_privileges/
1446

15-
flake8 my_project/
47+
echo -e "\n${YELLOW}> Pylama.${ENDCOLOR}"
48+
pylama /workspaces/app/snow_revoke_privileges/
1649

17-
echo -e "\n${YELLOW}> Mypy.${ENDCOLOR}\n"
50+
if [ "$?" -eq 0 ]; then
51+
echo -e "${GREEN}${BOLD}Success: no issues found${ENDCOLOR}"
52+
fi
1853

19-
mypy my_project/
54+
echo -e "\n${YELLOW}> Yapf.${ENDCOLOR}"
55+
yapf --diff /workspaces/app/snow_revoke_privileges/ --recursive
2056

21-
echo -e "\n${YELLOW}> Pylama.${ENDCOLOR}\n"
57+
if [ "$?" -eq 0 ]; then
58+
echo -e "${GREEN}${BOLD}Success: no issues found${ENDCOLOR}"
59+
fi
2260

23-
pylama my_project/
61+
echo -e "\n${YELLOW}> Pytest.${ENDCOLOR}\n"
62+
pytest ./tests/test_*.py -v -s -n auto --no-header --no-summary
2463

2564
echo -e "\n${BLUE}All verifications are done.${ENDCOLOR}\n"
+18
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
#!/bin/bash
2+
3+
source /workspaces/app/.venv/bin/activate
4+
sleep 0.5
5+
6+
RED="\e[31m"
7+
GREEN="\e[32m"
8+
BLUE="\e[34m"
9+
YELLOW="\e[33m"
10+
BOLD="\e[1m"
11+
12+
ENDCOLOR="\e[0m"
13+
14+
echo -e "\n${YELLOW}> Use: requirements-dev.txt${ENDCOLOR}\n"
15+
pip install -r /workspaces/app/requirements-dev.txt --upgrade
16+
17+
echo -e "\n${YELLOW}> Use: requirements.txt${ENDCOLOR}\n"
18+
pip install -r /workspaces/app/requirements.txt --upgrade

0 commit comments

Comments
 (0)