Skip to content

Commit 51dc8ea

Browse files
committed
Initial commit
0 parents  commit 51dc8ea

31 files changed

+4957
-0
lines changed

.envrc

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
# SPDX-FileCopyrightText: 2023 Gert van Dijk <[email protected]>
2+
#
3+
# SPDX-License-Identifier: CC0-1.0
4+
5+
set -e
6+
7+
layout python python3.11

.gitignore

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
# SPDX-FileCopyrightText: 2023 Gert van Dijk <[email protected]>
2+
#
3+
# SPDX-License-Identifier: CC0-1.0
4+
5+
*.egg-info/
6+
__pycache__/
7+
/.pytest_cache
8+
/build
9+
/dist
10+
/.direnv
11+
/.coverage
12+
/.pytest-cov

.vscode/.gitignore

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
# SPDX-FileCopyrightText: 2023 Gert van Dijk <[email protected]>
2+
#
3+
# SPDX-License-Identifier: CC0-1.0
4+
5+
/*.log

.vscode/extensions.json

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
{
2+
"recommendations": [
3+
"charliermarsh.ruff",
4+
"ms-python.black-formatter",
5+
"ms-python.mypy-type-checker",
6+
"ms-python.python",
7+
"ms-python.vscode-pylance",
8+
"ryanluker.vscode-coverage-gutters",
9+
]
10+
}

.vscode/extensions.json.license

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
SPDX-FileCopyrightText: 2023 Gert van Dijk <[email protected]>
2+
3+
SPDX-License-Identifier: CC0-1.0

.vscode/launch.json

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
{
2+
"version": "0.2.0",
3+
"configurations": [
4+
{
5+
// Overriding default Python debug test launcher command to disable coverage
6+
// (via env var below), because coverage reporting interferes with the
7+
// debugger.
8+
// https://code.visualstudio.com/docs/python/testing#_pytest-configuration-settings
9+
"name": "Python: Debug Tests",
10+
"type": "python",
11+
"request": "launch",
12+
"program": "${file}",
13+
"env": {
14+
"PYTEST_ADDOPTS": "--no-cov",
15+
},
16+
"purpose": [
17+
"debug-test",
18+
],
19+
"console": "integratedTerminal",
20+
"justMyCode": false,
21+
}
22+
]
23+
}

.vscode/launch.json.license

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
SPDX-FileCopyrightText: 2023 Gert van Dijk <[email protected]>
2+
3+
SPDX-License-Identifier: CC0-1.0

.vscode/settings.json

Lines changed: 59 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,59 @@
1+
{
2+
// Please set 'black-formatter.importStrategy' to 'fromEnvironment' in your
3+
// workspace (or user) settings to use the same Black version as in the
4+
// virtual environment. The Black plugin uses the bundled version by
5+
// default.
6+
// Not a valid folder-level setting.
7+
"black-formatter.importStrategy": "fromEnvironment",
8+
// Similar for Ruff, please set 'ruff.importStrategy' to 'fromEnvironment'
9+
// in your workspace (or user) settings to use the same Ruff version as in
10+
// the virtual environment. The Black plugin uses the bundled version by
11+
// default.
12+
// Not a valid folder-level setting as well.
13+
"ruff.importStrategy": "fromEnvironment",
14+
15+
// Enable 'editor.formatOnSave' to run black and other formatters on every (manual)
16+
// save. Suggested as user-level or workspace-level setting.
17+
// "editor.formatOnSave": true,
18+
19+
// Please set 'pytest.command' in your workspace (or user) settings to load
20+
// Pytest from the environment.
21+
// Not a valid folder-level setting.
22+
"pytest.command": "python -m pytest",
23+
24+
"files.exclude": {
25+
".coverage": true,
26+
".direnv/": true,
27+
".pytest_cache/": true,
28+
".pytest-cov/": true,
29+
".ruff_cache/": true,
30+
"**/__pycache__/": true,
31+
"**/.mypy_cache/": true,
32+
"**/*.egg-info/": true,
33+
"dist/": true,
34+
},
35+
"files.insertFinalNewline": true,
36+
"python.analysis.diagnosticMode": "workspace",
37+
"python.analysis.indexing": true,
38+
"python.analysis.typeCheckingMode": "strict",
39+
"[python]": {
40+
"editor.defaultFormatter": "ms-python.black-formatter",
41+
"editor.codeActionsOnSave": {
42+
"source.fixAll": true,
43+
"source.organizeImports": true,
44+
},
45+
"editor.rulers": [
46+
88, // black's default
47+
],
48+
},
49+
"python.testing.pytestEnabled": true,
50+
"coverage-gutters.coverageFileNames": [
51+
"coverage.xml",
52+
],
53+
"coverage-gutters.coverageBaseDir": ".pytest-cov",
54+
"coverage-gutters.coverageReportFileName": "html/index.html",
55+
56+
// Mypy extension with dmypy enabled does not always show the same mypy errors as
57+
// linter check script.
58+
"mypy-type-checker.preferDaemon": false,
59+
}

.vscode/settings.json.license

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
SPDX-FileCopyrightText: 2023 Gert van Dijk <[email protected]>
2+
3+
SPDX-License-Identifier: CC0-1.0

.vscode/tasks.json

Lines changed: 74 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,74 @@
1+
{
2+
"version": "2.0.0",
3+
"tasks": [
4+
{
5+
"label": "run-all-linters-whole-project",
6+
"type": "shell",
7+
"command": "PYTHON_INTERPRETER=\"${command:python.interpreterPath}\" ./run-all-linters",
8+
"icon": {
9+
"id": "checklist",
10+
"color": "terminal.ansiGreen"
11+
},
12+
"presentation": {
13+
"echo": true,
14+
"reveal": "silent",
15+
"focus": false,
16+
"panel": "shared",
17+
"showReuseMessage": false,
18+
"clear": true,
19+
"revealProblems": "onProblem",
20+
},
21+
"problemMatcher": [
22+
{
23+
"owner": "run-all-linters-whole-project",
24+
"source": "mypy (via run-all-linters)",
25+
"fileLocation": [
26+
"relative",
27+
"${workspaceFolder}",
28+
],
29+
"pattern": {
30+
// src/pykmp/myfile.py:32:37: error: Name "__qualname__" is not defined [name-defined]
31+
// includes match for ''.py' in filename to avoid matching on shellcheck's
32+
// output in gcc-format.
33+
"regexp": "^(.+\\.py.?):(\\d+):(\\d+): (\\w*): (.+)( \\[(.*)\\])?$",
34+
"file": 1,
35+
"line": 2,
36+
"column": 3,
37+
"code": 7,
38+
"severity": 4,
39+
"message": 5,
40+
},
41+
},
42+
{
43+
"owner": "run-all-linters-whole-project",
44+
"source": "Ruff (via run-all-linters)",
45+
"fileLocation": [
46+
"relative",
47+
"${workspaceFolder}",
48+
],
49+
"pattern": {
50+
// ./src/pykmp/myfile.py:5:1: F401 'typing.AsyncContextManager' imported but unused
51+
"regexp": "^(.+):(\\d+):(\\d+): ((\\w+)\\d+) (.+)$",
52+
"file": 1,
53+
"line": 2,
54+
"column": 3,
55+
"code": 4,
56+
"severity": 5,
57+
"message": 6,
58+
},
59+
},
60+
// The REUSE tool does not provide a machine-parsable output, because both the
61+
// summary and the listing of files with issues are presented in the same way.
62+
{
63+
"owner": "run-all-linters-whole-project",
64+
"source": "reuse-lint (via run-all-linters)",
65+
"pattern": {
66+
// Unfortunately, your project is not compliant with version 3.0 of the REUSE Specification :-(
67+
"regexp": "^(Unfortunately, your project is not compliant .*)",
68+
"message": 1,
69+
},
70+
},
71+
],
72+
},
73+
],
74+
}

.vscode/tasks.json.license

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
SPDX-FileCopyrightText: 2023 Gert van Dijk <[email protected]>
2+
3+
SPDX-License-Identifier: Apache-2.0

0 commit comments

Comments
 (0)