Skip to content

Commit

Permalink
Initial public release
Browse files Browse the repository at this point in the history
  • Loading branch information
gertvdijk committed Feb 5, 2023
0 parents commit 52dd681
Show file tree
Hide file tree
Showing 77 changed files with 8,277 additions and 0 deletions.
14 changes: 14 additions & 0 deletions .dockerignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
# SPDX-FileCopyrightText: 2023 Gert van Dijk
#
# SPDX-License-Identifier: CC0-1.0

/.coverage
/.direnv
/.git
/.mypy_cache
/.pytest_cache
/.pytest-cov
/.reuse
/.ruff_cache
/.vscode
/dist
5 changes: 5 additions & 0 deletions .envrc
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

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

# Flake8 does not support reading from pyproject.toml files.
# https://github.com/PyCQA/flake8/issues/234

[flake8]
# Match black's default
max-line-length = 88
extend-exclude =
*.egg-info/,
./.mypy_cache,
./.pytest_cache,
./build,
./dist,
./.direnv
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
12 changes: 12 additions & 0 deletions .vscode/extensions.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
{
"recommendations": [
"cameron.vscode-pytest",
"charliermarsh.ruff",
"exiasr.hadolint",
"ms-python.isort",
"ms-python.python",
"ms-python.vscode-pylance",
"ryanluker.vscode-coverage-gutters",
"timonwong.shellcheck",
]
}
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
56 changes: 56 additions & 0 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
{
"files.associations": {
".dockerignore": "ignore", // auto-interprets wrongly as Python somehow
},
"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.linting.mypyEnabled": true,
"python.linting.enabled": true,
"python.analysis.diagnosticMode": "workspace",
"python.analysis.indexing": true,
"python.analysis.typeCheckingMode": "strict",
"python.formatting.provider": "black",
"editor.rulers": [
88, // black's default
],
// https://github.com/microsoft/vscode-isort#import-sorting-on-save
"[python]": {
"editor.codeActionsOnSave": {
"source.organizeImports": true,
}
},
// for the 'ms-python.isort' extension.
// keep in sync with /run-all-linters script.
"isort.args": [
"--profile",
"black",
],
// Enable to run black+isort on every (manual) save, perhaps in user-level settings.
// "editor.formatOnSave": true,
"python.testing.pytestEnabled": true,
// For Pytest IntelliSense
// https://marketplace.visualstudio.com/items?itemName=Cameron.vscode-pytest
"pytest.command": "\"${command:python.interpreterPath}\" -m pytest",
"coverage-gutters.coverageFileNames": [
"coverage.xml",
],
"coverage-gutters.coverageBaseDir": ".pytest-cov",
"coverage-gutters.coverageReportFileName": "html/index.html",
"shellcheck.executablePath": "shellcheck",
"shellcheck.useWorkspaceRootAsCwd": true,
// for the 'timonwong.shellcheck' extension.
// keep in sync with /run-all-linters script.
"shellcheck.customArgs": [
"--norc",
],
}
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
123 changes: 123 additions & 0 deletions .vscode/tasks.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,123 @@
{
"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/purepythonmilter/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": "flake8 (via run-all-linters)",
"fileLocation": [
"relative",
"${workspaceFolder}",
],
"pattern": {
// ./src/purepythonmilter/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,
},
},
{
"owner": "run-all-linters-whole-project",
"source": "isort (via run-all-linters)",
"fileLocation": [
"absolute",
],
"pattern": {
// ERROR: /abs/path/to/purepythonmilter/src/myfile.py Imports are incorrectly sorted and/or formatted.
"regexp": "^([A-Z]+): (.+\\.py) (.+)$",
"severity": 1,
"file": 2,
"message": 3,
},
},
// 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,
},
},
{
"owner": "run-all-linters-whole-project",
"source": "hadolint (via run-all-linters)",
"fileLocation": [
"relative",
"${workspaceFolder}",
],
"pattern": {
// Dockerfile:11 DL3006 warning: Always tag the version of an image explicitly
"regexp": "^(.+):(\\d+) ([A-Z0-9]+) ([a-z]+): (.+)$",
"file": 1,
"line": 2,
"code": 3,
"severity": 4,
"message": 5,
},
},
{
"owner": "run-all-linters-whole-project",
"source": "shellcheck (via run-all-linters)",
"fileLocation": [
"relative",
"${workspaceFolder}",
],
"pattern": {
// filename:25:26: error: Double quote array expansions to avoid re-splitting elements. [SC2068]
"regexp": "^(.+):(\\d+):(\\d+): ([a-z]+): (.+) \\[(.*)\\]$",
"file": 1,
"line": 2,
"column": 3,
"code": 6,
"severity": 4,
"message": 5,
},
},
],
},
],
}
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 52dd681

Please sign in to comment.