assert-cpp-definition-is-used 20261130053311__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- assert_cpp_definition_is_used-20261130053311/.claude/memories/MEMORY.md +4 -0
- assert_cpp_definition_is_used-20261130053311/.claude/memories/commands-run-in-the-background.md +20 -0
- assert_cpp_definition_is_used-20261130053311/.claude/memories/push-to-main.md +14 -0
- assert_cpp_definition_is_used-20261130053311/.claude/settings.json +3 -0
- assert_cpp_definition_is_used-20261130053311/.claude/skills/autopilot/SKILL.md +76 -0
- assert_cpp_definition_is_used-20261130053311/.github/workflows/markdownlint.yml +46 -0
- assert_cpp_definition_is_used-20261130053311/.github/workflows/release.yml +316 -0
- assert_cpp_definition_is_used-20261130053311/.gitignore +55 -0
- assert_cpp_definition_is_used-20261130053311/LICENSE.txt +190 -0
- assert_cpp_definition_is_used-20261130053311/PKG-INFO +246 -0
- assert_cpp_definition_is_used-20261130053311/README.md +220 -0
- assert_cpp_definition_is_used-20261130053311/action.yml +86 -0
- assert_cpp_definition_is_used-20261130053311/pyproject.toml +47 -0
- assert_cpp_definition_is_used-20261130053311/setup.cfg +4 -0
- assert_cpp_definition_is_used-20261130053311/src/assert_cpp_definition_is_used/__init__.py +0 -0
- assert_cpp_definition_is_used-20261130053311/src/assert_cpp_definition_is_used/__main__.py +3 -0
- assert_cpp_definition_is_used-20261130053311/src/assert_cpp_definition_is_used/cli.py +270 -0
- assert_cpp_definition_is_used-20261130053311/src/assert_cpp_definition_is_used/py.typed +0 -0
- assert_cpp_definition_is_used-20261130053311/src/assert_cpp_definition_is_used/scanner.py +732 -0
- assert_cpp_definition_is_used-20261130053311/src/assert_cpp_definition_is_used.egg-info/PKG-INFO +246 -0
- assert_cpp_definition_is_used-20261130053311/src/assert_cpp_definition_is_used.egg-info/SOURCES.txt +40 -0
- assert_cpp_definition_is_used-20261130053311/src/assert_cpp_definition_is_used.egg-info/dependency_links.txt +1 -0
- assert_cpp_definition_is_used-20261130053311/src/assert_cpp_definition_is_used.egg-info/entry_points.txt +2 -0
- assert_cpp_definition_is_used-20261130053311/src/assert_cpp_definition_is_used.egg-info/requires.txt +1 -0
- assert_cpp_definition_is_used-20261130053311/src/assert_cpp_definition_is_used.egg-info/scm_file_list.json +36 -0
- assert_cpp_definition_is_used-20261130053311/src/assert_cpp_definition_is_used.egg-info/scm_version.json +8 -0
- assert_cpp_definition_is_used-20261130053311/src/assert_cpp_definition_is_used.egg-info/top_level.txt +1 -0
- assert_cpp_definition_is_used-20261130053311/test/__init__.py +0 -0
- assert_cpp_definition_is_used-20261130053311/test/conftest.py +96 -0
- assert_cpp_definition_is_used-20261130053311/test/e2e/__init__.py +0 -0
- assert_cpp_definition_is_used-20261130053311/test/e2e/conftest.py +14 -0
- assert_cpp_definition_is_used-20261130053311/test/e2e/test_e2e.py +53 -0
- assert_cpp_definition_is_used-20261130053311/test/integration/__init__.py +0 -0
- assert_cpp_definition_is_used-20261130053311/test/integration/test_options.py +205 -0
- assert_cpp_definition_is_used-20261130053311/test/integration/test_rules.py +126 -0
- assert_cpp_definition_is_used-20261130053311/test/runners.py +39 -0
- assert_cpp_definition_is_used-20261130053311/test/samples.py +422 -0
- assert_cpp_definition_is_used-20261130053311/test/unit/__init__.py +0 -0
- assert_cpp_definition_is_used-20261130053311/test/unit/conftest.py +33 -0
- assert_cpp_definition_is_used-20261130053311/test/unit/test_cli.py +259 -0
- assert_cpp_definition_is_used-20261130053311/test/unit/test_main.py +22 -0
- assert_cpp_definition_is_used-20261130053311/test/unit/test_scanner.py +409 -0
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
# Memories
|
|
2
|
+
|
|
3
|
+
- [Push to main](push-to-main.md) — commit and push straight to main, no branches or pull requests
|
|
4
|
+
- [Commands run in the background](commands-run-in-the-background.md) — every command that can go to the background goes there; only a quick one whose output the next call needs stays in the foreground
|
assert_cpp_definition_is_used-20261130053311/.claude/memories/commands-run-in-the-background.md
ADDED
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: commands-run-in-the-background
|
|
3
|
+
description: Send every command that can go to the background there, with run_in_background or Monitor, its output in a scratchpad file, and never follow it with a foreground wait
|
|
4
|
+
metadata:
|
|
5
|
+
type: feedback
|
|
6
|
+
---
|
|
7
|
+
|
|
8
|
+
# Commands run in the background
|
|
9
|
+
|
|
10
|
+
Send as many commands as possible to the background: a `Bash` call with `run_in_background: true`, or `Monitor` when the events along the way matter more than the end. Only a quick command whose output the very next call needs, such as a `git status` or a file read, stays in the foreground. Installs, builds, sweeps of `gh` calls, long `grep` or `find` runs over other repositories, and every watch of a CI run go in the background.
|
|
11
|
+
|
|
12
|
+
**Why:** The user said so. A foreground command holds the turn for as long as it runs, so the user cannot type and every scheduled reminder due in that time waits behind it. A background command frees the turn as soon as it starts.
|
|
13
|
+
|
|
14
|
+
**How to apply:**
|
|
15
|
+
|
|
16
|
+
- Send the output to a file in the scratchpad and read it once the notification arrives.
|
|
17
|
+
- Give a command that might not end a time limit. The shell has no `timeout`, so use `perl -e 'alarm <seconds>; exec @ARGV' <command>`.
|
|
18
|
+
- Never follow a background command with a foreground wait: no `sleep`, no `until` loop, and no rereading of its output file until it fills.
|
|
19
|
+
- Go on with other work that does not depend on the result; once only the result is left to wait for, end the turn.
|
|
20
|
+
- Watch a CI run with `gh run watch <id> --exit-status --interval 60` inside the background command: the default polls every 3 seconds and trips GitHub's rate limit over a long run.
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: push-to-main
|
|
3
|
+
description: Commits go straight to main with git push origin main; no feature branches or pull requests
|
|
4
|
+
metadata:
|
|
5
|
+
type: feedback
|
|
6
|
+
---
|
|
7
|
+
|
|
8
|
+
# Push to main
|
|
9
|
+
|
|
10
|
+
Commit on `main` and push with `git push origin main`, without opening a feature branch or a pull request.
|
|
11
|
+
|
|
12
|
+
**Why:** The user said so, matching the sibling 10U-Labs repositories, which commit straight to `main`.
|
|
13
|
+
|
|
14
|
+
**How to apply:** When asked to commit or push, do it on `main`; this overrides the default of branching first on the default branch. Starting the autopilot, `.claude/skills/autopilot/SKILL.md`, is the ask for what it solves. If GitHub declines the push because of a repository rule, report that to the user instead of switching to a pull request.
|
|
@@ -0,0 +1,76 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: autopilot
|
|
3
|
+
description: Start, restart or stop the autopilot reminders, which keep the session solving the open issues without being asked and end themselves when no issue is left to take. Use when the user says "start autopilot", "go autonomous on the open issues", "restart autopilot", "stop autopilot" or "reminders off", or asks to clear the reminders. Takes "start", "restart" or "stop"; "start" and "restart" also take `--skip-label <label>`, repeatable.
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# Autopilot
|
|
7
|
+
|
|
8
|
+
The autopilot is a set of scheduled reminders. Together they keep the session solving the open issues, in the order their `blocked by` edges set, until none is left that it can take. Then the autopilot ends itself, per "Ending itself".
|
|
9
|
+
|
|
10
|
+
Starting the autopilot is the user's request to commit and push what it solves: its work goes to `main` without a further go-ahead, and each push closes at least one issue, with a `Closes #N` line for each in the commit that finishes it.
|
|
11
|
+
|
|
12
|
+
Fetch `CronCreate`, `CronList` and `CronDelete` with `ToolSearch` first.
|
|
13
|
+
|
|
14
|
+
## Reminders
|
|
15
|
+
|
|
16
|
+
Each reminder states one rule and names one action. Each fires every fifteen minutes, on a minute of its own, and none falls on the hour or the half hour. A reminder fires only while the session is idle, which is why every command that can run long goes in the background.
|
|
17
|
+
|
|
18
|
+
There are six. The first, on `1,16,31,46 * * * *`, is the wait for CI:
|
|
19
|
+
|
|
20
|
+
```text
|
|
21
|
+
REMINDER: While a CI run that a push of this session started is queued or in progress, only wait: no reading, edits, issue writing, commits or pushes, except what the user instructs, which is done in full at once.
|
|
22
|
+
```
|
|
23
|
+
|
|
24
|
+
The second, on `3,18,33,48 * * * *`, takes the work:
|
|
25
|
+
|
|
26
|
+
```text
|
|
27
|
+
REMINDER: Run gh issue list --state open --limit 10000 --json number,title,labels --jq 'map(select(all(.labels[]; .name != "needs decision"))) | sort_by(.number) | map({number, title, labels: [.labels[].name]})' to list the open issues no label holds back, lowest number first; take the first issue it lists for which gh api repos/{owner}/{repo}/issues/<number>/dependencies/blocked_by --jq '.[].state' prints no open, alone or with other listed issues you choose to solve with it, and run the same command again when they close.
|
|
28
|
+
```
|
|
29
|
+
|
|
30
|
+
The other four:
|
|
31
|
+
|
|
32
|
+
| Cron | Prompt |
|
|
33
|
+
| --- | --- |
|
|
34
|
+
| `7,22,37,52 * * * *` | `REMINDER: When the listing names no issue that can be taken, end the autopilot: CronDelete every job that CronList returns.` |
|
|
35
|
+
| `9,24,39,54 * * * *` | `REMINDER: Continue autonomously: while an open issue can be taken, do not stop to ask or to report.` |
|
|
36
|
+
| `11,26,41,56 * * * *` | `REMINDER: When an issue you are working on cannot go on without a person's answer, hand it to a person by labelling it 'needs decision'.` |
|
|
37
|
+
| `13,28,43,58 * * * *` | `REMINDER: Run no test locally, of the unit, integration or end-to-end tier: push the tests with their code and let CI run them.` |
|
|
38
|
+
|
|
39
|
+
In a prompt, `<number>` stands for the issue being checked, and `gh api` fills in `{owner}` and `{repo}` from the repository the session runs in.
|
|
40
|
+
|
|
41
|
+
An issue can be taken when the listing names it and no open issue blocks it. A listing that names no issue has none that can be taken.
|
|
42
|
+
|
|
43
|
+
After a push the session does nothing else until every run the push started has ended, while a background command watches each run. What the user instructs is the one exception: the session does it in full during the wait, and a change it makes is committed and pushed, with the runs of that push watched as well. Another reminder that fires during that wait does not end it: the session ends its turn again.
|
|
44
|
+
|
|
45
|
+
## Ending itself
|
|
46
|
+
|
|
47
|
+
The autopilot ends itself when no issue can be taken: no issue is open, or each open issue carries a label that holds it back or is blocked by an open issue. The reminder on `7,22,37,52 * * * *` says so, and the session does not wait for it: the moment it finds nothing left, it ends the autopilot.
|
|
48
|
+
|
|
49
|
+
1. Run the listing's command, so that what is found is how the issues stand now. When it names an issue that can be taken after all, take it and do not end.
|
|
50
|
+
2. Run "Stop".
|
|
51
|
+
3. Tell the user that the autopilot has ended and why: that no issue is open, or which label or blocking issue holds back each open one.
|
|
52
|
+
|
|
53
|
+
The watches of the runs a push started are background commands and not reminders, so they go on. A watch that ends still resumes the session, and a run found to have failed is still fixed.
|
|
54
|
+
|
|
55
|
+
The autopilot does not start again by itself. An issue opened later, or a label taken off, is picked up when the user starts the autopilot again.
|
|
56
|
+
|
|
57
|
+
## Start
|
|
58
|
+
|
|
59
|
+
Each `--skip-label <label>` puts `map(select(all(.labels[]; .name != "<label>"))) |` and a space at the very start of the listing's `--jq` program, and appends `An issue labelled '<label>' is left to a person, whatever else it carries.` to the reminder that takes work. The filter stays in the `--jq` program and never moves to `--label` or `--search`, which send the listing through GitHub's search and its limit of 1000 issues.
|
|
60
|
+
|
|
61
|
+
An issue is blocked while `gh api repos/{owner}/{repo}/issues/<number>/dependencies/blocked_by` lists an open issue.
|
|
62
|
+
|
|
63
|
+
1. Make sure the label the autopilot leaves to a person exists: when `gh label list --search 'needs decision' --json name --jq '.[].name'` does not print `needs decision`, create it with `gh label create 'needs decision' --description 'Left to a person' --color d876e3`.
|
|
64
|
+
2. Run the listing's command once, its `--skip-label` filters in place. When it names no issue that can be taken, say so, say which label or blocking issue holds back each open issue, and stop: there is nothing to schedule reminders for.
|
|
65
|
+
3. Call `CronList`, and `CronDelete` each job whose prompt begins `REMINDER:` and is not one of the six reminders on its own cron. That clears a reminder left from before one was changed or moved to another minute.
|
|
66
|
+
4. `CronCreate` with `recurring: true` each of the six reminders that is not already scheduled.
|
|
67
|
+
5. Tell the user how many reminders are running, that the autopilot ends itself when no issue is left that it can take, and the two limits that come with the reminders: the jobs live in this session only and are gone when it ends, and recurring jobs auto-expire after thirty days.
|
|
68
|
+
6. Take the first listed issue that no open issue blocks, alone or with other listed issues chosen to be solved with it, and solve them. When they close, run the listing's command again. When it names no issue that can be taken, end the autopilot, per "Ending itself".
|
|
69
|
+
|
|
70
|
+
## Restart
|
|
71
|
+
|
|
72
|
+
Run "Stop", then "Start" with the `--skip-label` flags that `restart` was given. That leaves exactly the six reminders, each with thirty fresh days. It is how a changed set of `--skip-label` flags takes effect.
|
|
73
|
+
|
|
74
|
+
## Stop
|
|
75
|
+
|
|
76
|
+
`CronDelete` every job `CronList` returns, then call `CronList` again to confirm it is empty and report how many jobs were deleted. A `CronList` that returns nothing is not a failure; say the schedule was already empty.
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
---
|
|
2
|
+
concurrency:
|
|
3
|
+
cancel-in-progress: true
|
|
4
|
+
group: ${{ github.workflow }}-${{ github.ref }}
|
|
5
|
+
jobs:
|
|
6
|
+
markdownlint:
|
|
7
|
+
runs-on: ubuntu-latest
|
|
8
|
+
steps:
|
|
9
|
+
- name: Checkout code
|
|
10
|
+
uses: actions/checkout@v7
|
|
11
|
+
- name: Set up Node
|
|
12
|
+
uses: actions/setup-node@v7
|
|
13
|
+
with:
|
|
14
|
+
node-version: "20"
|
|
15
|
+
- name: Install dependencies
|
|
16
|
+
run: npm install -g markdownlint-cli
|
|
17
|
+
- name: markdownlint
|
|
18
|
+
run: markdownlint --dot --disable MD013 -- '**/*.md'
|
|
19
|
+
yamllint:
|
|
20
|
+
runs-on: ubuntu-latest
|
|
21
|
+
steps:
|
|
22
|
+
- name: Checkout code
|
|
23
|
+
uses: actions/checkout@v7
|
|
24
|
+
- name: Set up Python
|
|
25
|
+
uses: actions/setup-python@v7
|
|
26
|
+
with:
|
|
27
|
+
python-version: "3.13"
|
|
28
|
+
- name: Install dependencies
|
|
29
|
+
run: pip install yamllint
|
|
30
|
+
- name: yamllint
|
|
31
|
+
run: |
|
|
32
|
+
EMPTY_LINES='empty-lines: {max: 0, max-start: 0, max-end: 1}'
|
|
33
|
+
KEY_ORDERING='key-ordering: enable'
|
|
34
|
+
TRUTHY='truthy: {allowed-values: ["true", "false", "on"]}'
|
|
35
|
+
RULES="$EMPTY_LINES, $KEY_ORDERING, $TRUTHY"
|
|
36
|
+
yamllint --strict --format github \
|
|
37
|
+
--config-data "{extends: default, rules: {$RULES}}" \
|
|
38
|
+
.github/workflows/markdownlint.yml
|
|
39
|
+
name: markdownlint
|
|
40
|
+
on:
|
|
41
|
+
push:
|
|
42
|
+
branches:
|
|
43
|
+
- main
|
|
44
|
+
paths:
|
|
45
|
+
- "**.md"
|
|
46
|
+
- ".github/workflows/markdownlint.yml"
|
|
@@ -0,0 +1,316 @@
|
|
|
1
|
+
---
|
|
2
|
+
concurrency:
|
|
3
|
+
cancel-in-progress: true
|
|
4
|
+
group: ${{ github.workflow }}-${{ github.ref }}
|
|
5
|
+
jobs:
|
|
6
|
+
assert-no-comments:
|
|
7
|
+
runs-on: ubuntu-latest
|
|
8
|
+
steps:
|
|
9
|
+
- name: Checkout code
|
|
10
|
+
uses: actions/checkout@v7
|
|
11
|
+
- name: Set up Python
|
|
12
|
+
uses: actions/setup-python@v7
|
|
13
|
+
with:
|
|
14
|
+
python-version: "3.13"
|
|
15
|
+
- name: Install dependencies
|
|
16
|
+
run: pip install assert-no-comments
|
|
17
|
+
- name: assert-no-comments
|
|
18
|
+
run: >-
|
|
19
|
+
assert-no-comments
|
|
20
|
+
--verbose
|
|
21
|
+
${{ github.workspace }}
|
|
22
|
+
assert-no-inline-directives:
|
|
23
|
+
runs-on: ubuntu-latest
|
|
24
|
+
steps:
|
|
25
|
+
- name: Checkout code
|
|
26
|
+
uses: actions/checkout@v7
|
|
27
|
+
- name: Set up Python
|
|
28
|
+
uses: actions/setup-python@v7
|
|
29
|
+
with:
|
|
30
|
+
python-version: "3.13"
|
|
31
|
+
- name: Install dependencies
|
|
32
|
+
run: pip install assert-no-inline-directives
|
|
33
|
+
- name: assert-no-inline-directives
|
|
34
|
+
run: >-
|
|
35
|
+
assert-no-inline-directives
|
|
36
|
+
--tools markdownlint,mypy,pylint,yamllint
|
|
37
|
+
--verbose
|
|
38
|
+
${{ github.workspace }}/**/*
|
|
39
|
+
assert-no-linter-config-files:
|
|
40
|
+
runs-on: ubuntu-latest
|
|
41
|
+
steps:
|
|
42
|
+
- name: Checkout code
|
|
43
|
+
uses: actions/checkout@v7
|
|
44
|
+
- name: Set up Python
|
|
45
|
+
uses: actions/setup-python@v7
|
|
46
|
+
with:
|
|
47
|
+
python-version: "3.13"
|
|
48
|
+
- name: Install dependencies
|
|
49
|
+
run: pip install assert-no-linter-config-files
|
|
50
|
+
- name: assert-no-linter-config-files
|
|
51
|
+
run: >-
|
|
52
|
+
assert-no-linter-config-files
|
|
53
|
+
--linters markdownlint,mypy,pylint,yamllint
|
|
54
|
+
--verbose
|
|
55
|
+
${{ github.workspace }}
|
|
56
|
+
assert-one-assert-per-pytest:
|
|
57
|
+
runs-on: ubuntu-latest
|
|
58
|
+
steps:
|
|
59
|
+
- name: Checkout code
|
|
60
|
+
uses: actions/checkout@v7
|
|
61
|
+
- name: Set up Python
|
|
62
|
+
uses: actions/setup-python@v7
|
|
63
|
+
with:
|
|
64
|
+
python-version: "3.13"
|
|
65
|
+
- name: Install dependencies
|
|
66
|
+
run: pip install assert-one-assert-per-pytest
|
|
67
|
+
- name: assert-one-assert-per-pytest
|
|
68
|
+
run: >-
|
|
69
|
+
assert-one-assert-per-pytest
|
|
70
|
+
--verbose
|
|
71
|
+
${{ github.workspace }}/test
|
|
72
|
+
assert-python-definition-is-used:
|
|
73
|
+
runs-on: ubuntu-latest
|
|
74
|
+
steps:
|
|
75
|
+
- name: Checkout code
|
|
76
|
+
uses: actions/checkout@v7
|
|
77
|
+
- name: Set up Python
|
|
78
|
+
uses: actions/setup-python@v7
|
|
79
|
+
with:
|
|
80
|
+
python-version: "3.13"
|
|
81
|
+
- name: Install dependencies
|
|
82
|
+
run: pip install assert-python-definition-is-used
|
|
83
|
+
- name: assert-python-definition-is-used
|
|
84
|
+
run: >-
|
|
85
|
+
assert-python-definition-is-used
|
|
86
|
+
src
|
|
87
|
+
--search-in src
|
|
88
|
+
--search-in test
|
|
89
|
+
--verbose
|
|
90
|
+
e2e-tests:
|
|
91
|
+
runs-on: ubuntu-latest
|
|
92
|
+
steps:
|
|
93
|
+
- name: Checkout code
|
|
94
|
+
uses: actions/checkout@v7
|
|
95
|
+
- name: Set up Python
|
|
96
|
+
uses: actions/setup-python@v7
|
|
97
|
+
with:
|
|
98
|
+
python-version: "3.13"
|
|
99
|
+
- name: Install dependencies
|
|
100
|
+
run: pip install pytest -e .
|
|
101
|
+
- name: E2E tests
|
|
102
|
+
run: python3 -m pytest test/e2e/ --verbose --pythonwarnings=error
|
|
103
|
+
integration-tests:
|
|
104
|
+
runs-on: ubuntu-latest
|
|
105
|
+
steps:
|
|
106
|
+
- name: Checkout code
|
|
107
|
+
uses: actions/checkout@v7
|
|
108
|
+
- name: Set up Python
|
|
109
|
+
uses: actions/setup-python@v7
|
|
110
|
+
with:
|
|
111
|
+
python-version: "3.13"
|
|
112
|
+
- name: Install dependencies
|
|
113
|
+
run: pip install pytest pytest-cov -e .
|
|
114
|
+
- name: Integration tests
|
|
115
|
+
run: |
|
|
116
|
+
python3 -m pytest test/integration/ \
|
|
117
|
+
--verbose --pythonwarnings=error \
|
|
118
|
+
--cov=assert_cpp_definition_is_used \
|
|
119
|
+
--cov-branch \
|
|
120
|
+
--cov-report=term-missing \
|
|
121
|
+
--cov-fail-under=100
|
|
122
|
+
jscpd-src:
|
|
123
|
+
runs-on: ubuntu-latest
|
|
124
|
+
steps:
|
|
125
|
+
- name: Checkout code
|
|
126
|
+
uses: actions/checkout@v7
|
|
127
|
+
- name: Set up Node
|
|
128
|
+
uses: actions/setup-node@v7
|
|
129
|
+
with:
|
|
130
|
+
node-version: "20"
|
|
131
|
+
- name: Install dependencies
|
|
132
|
+
run: npm install -g jscpd
|
|
133
|
+
- name: jscpd (src)
|
|
134
|
+
run: jscpd --pattern "**/*.py" --threshold 0 --reporters console src/
|
|
135
|
+
jscpd-test:
|
|
136
|
+
runs-on: ubuntu-latest
|
|
137
|
+
steps:
|
|
138
|
+
- name: Checkout code
|
|
139
|
+
uses: actions/checkout@v7
|
|
140
|
+
- name: Set up Node
|
|
141
|
+
uses: actions/setup-node@v7
|
|
142
|
+
with:
|
|
143
|
+
node-version: "20"
|
|
144
|
+
- name: Install dependencies
|
|
145
|
+
run: npm install -g jscpd
|
|
146
|
+
- name: jscpd (test)
|
|
147
|
+
run: jscpd --pattern "**/*.py" --threshold 0 --reporters console test/
|
|
148
|
+
mypy-src:
|
|
149
|
+
runs-on: ubuntu-latest
|
|
150
|
+
steps:
|
|
151
|
+
- name: Checkout code
|
|
152
|
+
uses: actions/checkout@v7
|
|
153
|
+
- name: Set up Python
|
|
154
|
+
uses: actions/setup-python@v7
|
|
155
|
+
with:
|
|
156
|
+
python-version: "3.13"
|
|
157
|
+
- name: Install dependencies
|
|
158
|
+
run: pip install mypy types-clang -e .
|
|
159
|
+
- name: mypy (src)
|
|
160
|
+
run: python3 -m mypy --strict src/
|
|
161
|
+
mypy-test:
|
|
162
|
+
runs-on: ubuntu-latest
|
|
163
|
+
steps:
|
|
164
|
+
- name: Checkout code
|
|
165
|
+
uses: actions/checkout@v7
|
|
166
|
+
- name: Set up Python
|
|
167
|
+
uses: actions/setup-python@v7
|
|
168
|
+
with:
|
|
169
|
+
python-version: "3.13"
|
|
170
|
+
- name: Install dependencies
|
|
171
|
+
run: pip install mypy pytest types-clang -e .
|
|
172
|
+
- name: mypy (test)
|
|
173
|
+
run: python3 -m mypy test/
|
|
174
|
+
pylint-src:
|
|
175
|
+
runs-on: ubuntu-latest
|
|
176
|
+
steps:
|
|
177
|
+
- name: Checkout code
|
|
178
|
+
uses: actions/checkout@v7
|
|
179
|
+
- name: Set up Python
|
|
180
|
+
uses: actions/setup-python@v7
|
|
181
|
+
with:
|
|
182
|
+
python-version: "3.13"
|
|
183
|
+
- name: Install dependencies
|
|
184
|
+
run: pip install pylint -e .
|
|
185
|
+
- name: pylint (src)
|
|
186
|
+
run: >-
|
|
187
|
+
python3 -m pylint src/
|
|
188
|
+
--disable=missing-class-docstring
|
|
189
|
+
--disable=missing-function-docstring
|
|
190
|
+
--disable=missing-module-docstring
|
|
191
|
+
--fail-on=C,R,W
|
|
192
|
+
--fail-under=10.0
|
|
193
|
+
pylint-test:
|
|
194
|
+
runs-on: ubuntu-latest
|
|
195
|
+
steps:
|
|
196
|
+
- name: Checkout code
|
|
197
|
+
uses: actions/checkout@v7
|
|
198
|
+
- name: Set up Python
|
|
199
|
+
uses: actions/setup-python@v7
|
|
200
|
+
with:
|
|
201
|
+
python-version: "3.13"
|
|
202
|
+
- name: Install dependencies
|
|
203
|
+
run: pip install pylint pytest -e .
|
|
204
|
+
- name: pylint (test)
|
|
205
|
+
run: >-
|
|
206
|
+
python3 -m pylint test/
|
|
207
|
+
--disable=missing-class-docstring
|
|
208
|
+
--disable=missing-function-docstring
|
|
209
|
+
--disable=missing-module-docstring
|
|
210
|
+
--fail-on=C,R,W
|
|
211
|
+
--fail-under=10.0
|
|
212
|
+
release:
|
|
213
|
+
if: github.event_name == 'push'
|
|
214
|
+
needs:
|
|
215
|
+
- assert-no-comments
|
|
216
|
+
- assert-no-inline-directives
|
|
217
|
+
- assert-no-linter-config-files
|
|
218
|
+
- assert-one-assert-per-pytest
|
|
219
|
+
- assert-python-definition-is-used
|
|
220
|
+
- e2e-tests
|
|
221
|
+
- integration-tests
|
|
222
|
+
- jscpd-src
|
|
223
|
+
- jscpd-test
|
|
224
|
+
- mypy-src
|
|
225
|
+
- mypy-test
|
|
226
|
+
- pylint-src
|
|
227
|
+
- pylint-test
|
|
228
|
+
- unit-tests
|
|
229
|
+
- yamllint
|
|
230
|
+
permissions:
|
|
231
|
+
contents: write
|
|
232
|
+
id-token: write
|
|
233
|
+
runs-on: ubuntu-latest
|
|
234
|
+
steps:
|
|
235
|
+
- name: Checkout code
|
|
236
|
+
uses: actions/checkout@v7
|
|
237
|
+
with:
|
|
238
|
+
fetch-depth: 0
|
|
239
|
+
- name: Set up Python
|
|
240
|
+
uses: actions/setup-python@v7
|
|
241
|
+
with:
|
|
242
|
+
python-version: "3.13"
|
|
243
|
+
- id: version
|
|
244
|
+
name: Generate version from UTC time
|
|
245
|
+
run: echo "version=$(date -u +%Y%m%d%H%M%S)" >> $GITHUB_OUTPUT
|
|
246
|
+
- name: Create tag
|
|
247
|
+
run: git tag "v${{ steps.version.outputs.version }}"
|
|
248
|
+
- name: Install build tools
|
|
249
|
+
run: pip install build
|
|
250
|
+
- name: Build package
|
|
251
|
+
run: python -m build
|
|
252
|
+
- name: Publish to PyPI
|
|
253
|
+
uses: pypa/gh-action-pypi-publish@release/v1
|
|
254
|
+
- name: Push tag
|
|
255
|
+
run: git push origin "v${{ steps.version.outputs.version }}"
|
|
256
|
+
- env:
|
|
257
|
+
GH_TOKEN: ${{ github.token }}
|
|
258
|
+
name: Create GitHub Release
|
|
259
|
+
run: |
|
|
260
|
+
gh release create "v${{ steps.version.outputs.version }}" \
|
|
261
|
+
--generate-notes
|
|
262
|
+
- name: Update latest tag
|
|
263
|
+
run: |
|
|
264
|
+
git tag -f latest
|
|
265
|
+
git push origin latest --force
|
|
266
|
+
unit-tests:
|
|
267
|
+
runs-on: ubuntu-latest
|
|
268
|
+
steps:
|
|
269
|
+
- name: Checkout code
|
|
270
|
+
uses: actions/checkout@v7
|
|
271
|
+
- name: Set up Python
|
|
272
|
+
uses: actions/setup-python@v7
|
|
273
|
+
with:
|
|
274
|
+
python-version: "3.13"
|
|
275
|
+
- name: Install dependencies
|
|
276
|
+
run: pip install pytest pytest-cov -e .
|
|
277
|
+
- name: Unit tests
|
|
278
|
+
run: |
|
|
279
|
+
python3 -m pytest test/unit/ \
|
|
280
|
+
--verbose --pythonwarnings=error \
|
|
281
|
+
--cov=assert_cpp_definition_is_used \
|
|
282
|
+
--cov-branch \
|
|
283
|
+
--cov-report=term-missing \
|
|
284
|
+
--cov-fail-under=100
|
|
285
|
+
yamllint:
|
|
286
|
+
runs-on: ubuntu-latest
|
|
287
|
+
steps:
|
|
288
|
+
- name: Checkout code
|
|
289
|
+
uses: actions/checkout@v7
|
|
290
|
+
- name: Set up Python
|
|
291
|
+
uses: actions/setup-python@v7
|
|
292
|
+
with:
|
|
293
|
+
python-version: "3.13"
|
|
294
|
+
- name: Install dependencies
|
|
295
|
+
run: pip install yamllint
|
|
296
|
+
- name: yamllint
|
|
297
|
+
run: |
|
|
298
|
+
EMPTY_LINES='empty-lines: {max: 0, max-start: 0, max-end: 1}'
|
|
299
|
+
KEY_ORDERING='key-ordering: enable'
|
|
300
|
+
TRUTHY='truthy: {allowed-values: ["true", "false", "on"]}'
|
|
301
|
+
RULES="$EMPTY_LINES, $KEY_ORDERING, $TRUTHY"
|
|
302
|
+
yamllint --strict --format github \
|
|
303
|
+
--config-data "{extends: default, rules: {$RULES}}" \
|
|
304
|
+
action.yml .github/workflows/release.yml
|
|
305
|
+
name: release
|
|
306
|
+
on:
|
|
307
|
+
push:
|
|
308
|
+
branches:
|
|
309
|
+
- main
|
|
310
|
+
paths:
|
|
311
|
+
- ".github/workflows/markdownlint.yml"
|
|
312
|
+
- ".github/workflows/release.yml"
|
|
313
|
+
- "action.yml"
|
|
314
|
+
- "pyproject.toml"
|
|
315
|
+
- "src/**"
|
|
316
|
+
- "test/**"
|
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
*$py.class
|
|
2
|
+
*.cover
|
|
3
|
+
*.egg
|
|
4
|
+
*.egg-info/
|
|
5
|
+
*.manifest
|
|
6
|
+
*.mo
|
|
7
|
+
*.pot
|
|
8
|
+
*.py,cover
|
|
9
|
+
*.py[cod]
|
|
10
|
+
*.so
|
|
11
|
+
*.spec
|
|
12
|
+
*.swo
|
|
13
|
+
*.swp
|
|
14
|
+
.DS_Store
|
|
15
|
+
.Python
|
|
16
|
+
.cache
|
|
17
|
+
.claude/settings.local.json
|
|
18
|
+
.coverage
|
|
19
|
+
.coverage.*
|
|
20
|
+
.dmypy.json
|
|
21
|
+
.eggs/
|
|
22
|
+
.env
|
|
23
|
+
.hypothesis/
|
|
24
|
+
.idea/
|
|
25
|
+
.installed.cfg
|
|
26
|
+
.mypy_cache/
|
|
27
|
+
.nox/
|
|
28
|
+
.pytest_cache/
|
|
29
|
+
.ruff_cache/
|
|
30
|
+
.tox/
|
|
31
|
+
.venv
|
|
32
|
+
.vscode/
|
|
33
|
+
ENV/
|
|
34
|
+
__pycache__/
|
|
35
|
+
build/
|
|
36
|
+
coverage.xml
|
|
37
|
+
develop-eggs/
|
|
38
|
+
dist/
|
|
39
|
+
dmypy.json
|
|
40
|
+
downloads/
|
|
41
|
+
eggs/
|
|
42
|
+
env.bak/
|
|
43
|
+
env/
|
|
44
|
+
htmlcov/
|
|
45
|
+
lib/
|
|
46
|
+
lib64/
|
|
47
|
+
nosetests.xml
|
|
48
|
+
parts/
|
|
49
|
+
pip-delete-this-directory.txt
|
|
50
|
+
pip-log.txt
|
|
51
|
+
sdist/
|
|
52
|
+
var/
|
|
53
|
+
venv.bak/
|
|
54
|
+
venv/
|
|
55
|
+
wheels/
|