Skip to content

Commit

Permalink
Initial commit
Browse files Browse the repository at this point in the history
  • Loading branch information
gertvdijk committed Sep 24, 2023
0 parents commit 51dc8ea
Show file tree
Hide file tree
Showing 31 changed files with 4,957 additions and 0 deletions.
7 changes: 7 additions & 0 deletions .envrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
# SPDX-FileCopyrightText: 2023 Gert van Dijk <github@gertvandijk.nl>
#
# SPDX-License-Identifier: CC0-1.0

set -e

layout python python3.11
12 changes: 12 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
# SPDX-FileCopyrightText: 2023 Gert van Dijk <github@gertvandijk.nl>
#
# SPDX-License-Identifier: CC0-1.0

*.egg-info/
__pycache__/
/.pytest_cache
/build
/dist
/.direnv
/.coverage
/.pytest-cov
5 changes: 5 additions & 0 deletions .vscode/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
# SPDX-FileCopyrightText: 2023 Gert van Dijk <github@gertvandijk.nl>
#
# SPDX-License-Identifier: CC0-1.0

/*.log
10 changes: 10 additions & 0 deletions .vscode/extensions.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
{
"recommendations": [
"charliermarsh.ruff",
"ms-python.black-formatter",
"ms-python.mypy-type-checker",
"ms-python.python",
"ms-python.vscode-pylance",
"ryanluker.vscode-coverage-gutters",
]
}
3 changes: 3 additions & 0 deletions .vscode/extensions.json.license
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
SPDX-FileCopyrightText: 2023 Gert van Dijk <github@gertvandijk.nl>

SPDX-License-Identifier: CC0-1.0
23 changes: 23 additions & 0 deletions .vscode/launch.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
{
"version": "0.2.0",
"configurations": [
{
// Overriding default Python debug test launcher command to disable coverage
// (via env var below), because coverage reporting interferes with the
// debugger.
// https://code.visualstudio.com/docs/python/testing#_pytest-configuration-settings
"name": "Python: Debug Tests",
"type": "python",
"request": "launch",
"program": "${file}",
"env": {
"PYTEST_ADDOPTS": "--no-cov",
},
"purpose": [
"debug-test",
],
"console": "integratedTerminal",
"justMyCode": false,
}
]
}
3 changes: 3 additions & 0 deletions .vscode/launch.json.license
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
SPDX-FileCopyrightText: 2023 Gert van Dijk <github@gertvandijk.nl>

SPDX-License-Identifier: CC0-1.0
59 changes: 59 additions & 0 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,59 @@
{
// Please set 'black-formatter.importStrategy' to 'fromEnvironment' in your
// workspace (or user) settings to use the same Black version as in the
// virtual environment. The Black plugin uses the bundled version by
// default.
// Not a valid folder-level setting.
"black-formatter.importStrategy": "fromEnvironment",
// Similar for Ruff, please set 'ruff.importStrategy' to 'fromEnvironment'
// in your workspace (or user) settings to use the same Ruff version as in
// the virtual environment. The Black plugin uses the bundled version by
// default.
// Not a valid folder-level setting as well.
"ruff.importStrategy": "fromEnvironment",

// Enable 'editor.formatOnSave' to run black and other formatters on every (manual)
// save. Suggested as user-level or workspace-level setting.
// "editor.formatOnSave": true,

// Please set 'pytest.command' in your workspace (or user) settings to load
// Pytest from the environment.
// Not a valid folder-level setting.
"pytest.command": "python -m pytest",

"files.exclude": {
".coverage": true,
".direnv/": true,
".pytest_cache/": true,
".pytest-cov/": true,
".ruff_cache/": true,
"**/__pycache__/": true,
"**/.mypy_cache/": true,
"**/*.egg-info/": true,
"dist/": true,
},
"files.insertFinalNewline": true,
"python.analysis.diagnosticMode": "workspace",
"python.analysis.indexing": true,
"python.analysis.typeCheckingMode": "strict",
"[python]": {
"editor.defaultFormatter": "ms-python.black-formatter",
"editor.codeActionsOnSave": {
"source.fixAll": true,
"source.organizeImports": true,
},
"editor.rulers": [
88, // black's default
],
},
"python.testing.pytestEnabled": true,
"coverage-gutters.coverageFileNames": [
"coverage.xml",
],
"coverage-gutters.coverageBaseDir": ".pytest-cov",
"coverage-gutters.coverageReportFileName": "html/index.html",

// Mypy extension with dmypy enabled does not always show the same mypy errors as
// linter check script.
"mypy-type-checker.preferDaemon": false,
}
3 changes: 3 additions & 0 deletions .vscode/settings.json.license
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
SPDX-FileCopyrightText: 2023 Gert van Dijk <github@gertvandijk.nl>

SPDX-License-Identifier: CC0-1.0
74 changes: 74 additions & 0 deletions .vscode/tasks.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,74 @@
{
"version": "2.0.0",
"tasks": [
{
"label": "run-all-linters-whole-project",
"type": "shell",
"command": "PYTHON_INTERPRETER=\"${command:python.interpreterPath}\" ./run-all-linters",
"icon": {
"id": "checklist",
"color": "terminal.ansiGreen"
},
"presentation": {
"echo": true,
"reveal": "silent",
"focus": false,
"panel": "shared",
"showReuseMessage": false,
"clear": true,
"revealProblems": "onProblem",
},
"problemMatcher": [
{
"owner": "run-all-linters-whole-project",
"source": "mypy (via run-all-linters)",
"fileLocation": [
"relative",
"${workspaceFolder}",
],
"pattern": {
// src/pykmp/myfile.py:32:37: error: Name "__qualname__" is not defined [name-defined]
// includes match for ''.py' in filename to avoid matching on shellcheck's
// output in gcc-format.
"regexp": "^(.+\\.py.?):(\\d+):(\\d+): (\\w*): (.+)( \\[(.*)\\])?$",
"file": 1,
"line": 2,
"column": 3,
"code": 7,
"severity": 4,
"message": 5,
},
},
{
"owner": "run-all-linters-whole-project",
"source": "Ruff (via run-all-linters)",
"fileLocation": [
"relative",
"${workspaceFolder}",
],
"pattern": {
// ./src/pykmp/myfile.py:5:1: F401 'typing.AsyncContextManager' imported but unused
"regexp": "^(.+):(\\d+):(\\d+): ((\\w+)\\d+) (.+)$",
"file": 1,
"line": 2,
"column": 3,
"code": 4,
"severity": 5,
"message": 6,
},
},
// The REUSE tool does not provide a machine-parsable output, because both the
// summary and the listing of files with issues are presented in the same way.
{
"owner": "run-all-linters-whole-project",
"source": "reuse-lint (via run-all-linters)",
"pattern": {
// Unfortunately, your project is not compliant with version 3.0 of the REUSE Specification :-(
"regexp": "^(Unfortunately, your project is not compliant .*)",
"message": 1,
},
},
],
},
],
}
3 changes: 3 additions & 0 deletions .vscode/tasks.json.license
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
SPDX-FileCopyrightText: 2023 Gert van Dijk <github@gertvandijk.nl>

SPDX-License-Identifier: Apache-2.0
Loading

0 comments on commit 51dc8ea

Please sign in to comment.