strict-suite 0.1.0__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.
- strict_suite-0.1.0/.github/workflows/ci.yml +45 -0
- strict_suite-0.1.0/.github/workflows/cleanup-guard.yml +64 -0
- strict_suite-0.1.0/.github/workflows/no-ai-attribution.yml +73 -0
- strict_suite-0.1.0/.github/workflows/prose-dash-gate.yml +32 -0
- strict_suite-0.1.0/.github/workflows/publish.yml +35 -0
- strict_suite-0.1.0/.github/workflows/ruff.yml +29 -0
- strict_suite-0.1.0/.github/workflows/stricts.yml +39 -0
- strict_suite-0.1.0/.gitignore +50 -0
- strict_suite-0.1.0/CHANGELOG.md +23 -0
- strict_suite-0.1.0/CODE_OF_CONDUCT.md +31 -0
- strict_suite-0.1.0/CONTRIBUTING.md +31 -0
- strict_suite-0.1.0/LICENSE +201 -0
- strict_suite-0.1.0/PKG-INFO +301 -0
- strict_suite-0.1.0/README.md +270 -0
- strict_suite-0.1.0/SECURITY.md +18 -0
- strict_suite-0.1.0/docs/README.md +110 -0
- strict_suite-0.1.0/docs/strict_module/CHANGELOG-history.md +160 -0
- strict_suite-0.1.0/docs/strict_module/audits/cli-audit.md +54 -0
- strict_suite-0.1.0/docs/strict_module/audits/config-layer-audit.md +59 -0
- strict_suite-0.1.0/docs/strict_module/audits/linter-rules-engine-audit.md +43 -0
- strict_suite-0.1.0/docs/strict_module/audits/loc-cap-subcommand-audit.md +54 -0
- strict_suite-0.1.0/docs/strict_module/reviews/cli-review.md +64 -0
- strict_suite-0.1.0/docs/strict_module/reviews/config-layer-review.md +75 -0
- strict_suite-0.1.0/docs/strict_module/reviews/linter-rules-engine-review.md +50 -0
- strict_suite-0.1.0/docs/strict_module/reviews/loc-cap-subcommand-review.md +67 -0
- strict_suite-0.1.0/pyproject.toml +81 -0
- strict_suite-0.1.0/strict_module/__init__.py +7 -0
- strict_suite-0.1.0/strict_module/checkers.py +790 -0
- strict_suite-0.1.0/strict_module/cli.py +157 -0
- strict_suite-0.1.0/strict_module/config/__init__.py +6 -0
- strict_suite-0.1.0/strict_module/config/_config.py +99 -0
- strict_suite-0.1.0/strict_module/config/_version.py +3 -0
- strict_suite-0.1.0/strict_module/linter.py +207 -0
- strict_suite-0.1.0/strict_module/loc_cap.py +195 -0
- strict_suite-0.1.0/strict_module/py.typed +0 -0
- strict_suite-0.1.0/strict_module/rules.py +296 -0
- strict_suite-0.1.0/strict_module/tests/fixtures/bad/r001_bad_param.py +13 -0
- strict_suite-0.1.0/strict_module/tests/fixtures/bad/r001_bad_return.py +13 -0
- strict_suite-0.1.0/strict_module/tests/fixtures/bad/r002_bad_inline.py +22 -0
- strict_suite-0.1.0/strict_module/tests/fixtures/bad/r002_bad_non_serializer.py +32 -0
- strict_suite-0.1.0/strict_module/tests/fixtures/bad/r003_bad_dataclass.py +26 -0
- strict_suite-0.1.0/strict_module/tests/fixtures/bad/r004_bad_facade.py +16 -0
- strict_suite-0.1.0/strict_module/tests/fixtures/bad/r005_bad_validator.py +18 -0
- strict_suite-0.1.0/strict_module/tests/fixtures/bad/test_r007_bad_fixtures.py +14 -0
- strict_suite-0.1.0/strict_module/tests/fixtures/bad/test_r008_bad_bare_test_functions.py +17 -0
- strict_suite-0.1.0/strict_module/tests/fixtures/good/r001_good_basic.py +29 -0
- strict_suite-0.1.0/strict_module/tests/fixtures/good/r002_good_dict.py +27 -0
- strict_suite-0.1.0/strict_module/tests/fixtures/good/r002_good_serializer.py +37 -0
- strict_suite-0.1.0/strict_module/tests/fixtures/good/r002_multiple_dataclass_serializers.py +54 -0
- strict_suite-0.1.0/strict_module/tests/fixtures/good/r003_good_dataclass.py +20 -0
- strict_suite-0.1.0/strict_module/tests/fixtures/good/r004_good_facade.py +19 -0
- strict_suite-0.1.0/strict_module/tests/fixtures/good/r005_good_validator.py +36 -0
- strict_suite-0.1.0/strict_module/tests/fixtures/good/test_r008_good_test_class.py +22 -0
- strict_suite-0.1.0/strict_module/tests/test_baseline_ratchet.py +154 -0
- strict_suite-0.1.0/strict_module/tests/test_cli.py +94 -0
- strict_suite-0.1.0/strict_module/tests/test_compat_fallback.py +98 -0
- strict_suite-0.1.0/strict_module/tests/test_config_loading.py +46 -0
- strict_suite-0.1.0/strict_module/tests/test_github_format.py +68 -0
- strict_suite-0.1.0/strict_module/tests/test_loc_cap.py +289 -0
- strict_suite-0.1.0/strict_module/tests/test_loc_cap_test_exemption.py +77 -0
- strict_suite-0.1.0/strict_module/tests/test_noqa.py +132 -0
- strict_suite-0.1.0/strict_module/tests/test_noqa_r002.py +253 -0
- strict_suite-0.1.0/strict_module/tests/test_r001_dict_str_any.py +46 -0
- strict_suite-0.1.0/strict_module/tests/test_r001_strict_collections.py +108 -0
- strict_suite-0.1.0/strict_module/tests/test_r002_annotated_constants.py +158 -0
- strict_suite-0.1.0/strict_module/tests/test_r002_configurable_threshold.py +133 -0
- strict_suite-0.1.0/strict_module/tests/test_r002_inline_dict.py +37 -0
- strict_suite-0.1.0/strict_module/tests/test_r002_justification.py +98 -0
- strict_suite-0.1.0/strict_module/tests/test_r002_multiple_dataclass_regression.py +65 -0
- strict_suite-0.1.0/strict_module/tests/test_r002_serializer_exemption.py +50 -0
- strict_suite-0.1.0/strict_module/tests/test_r003_canonical.py +94 -0
- strict_suite-0.1.0/strict_module/tests/test_r003_dataclass_trio.py +38 -0
- strict_suite-0.1.0/strict_module/tests/test_r003_strict_relaxed.py +173 -0
- strict_suite-0.1.0/strict_module/tests/test_r004_auto_detect.py +134 -0
- strict_suite-0.1.0/strict_module/tests/test_r004_module_facade.py +38 -0
- strict_suite-0.1.0/strict_module/tests/test_r005_validator_pattern.py +37 -0
- strict_suite-0.1.0/strict_module/tests/test_r006_any.py +107 -0
- strict_suite-0.1.0/strict_module/tests/test_r007_fixtures.py +56 -0
- strict_suite-0.1.0/strict_module/tests/test_r008_test_functions.py +42 -0
- strict_suite-0.1.0/strict_module/tests/test_service_test_exemption.py +113 -0
- strict_suite-0.1.0/uv.lock +491 -0
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
name: CI
|
|
2
|
+
|
|
3
|
+
on:
|
|
4
|
+
pull_request:
|
|
5
|
+
push:
|
|
6
|
+
branches: [main]
|
|
7
|
+
|
|
8
|
+
concurrency:
|
|
9
|
+
group: ${{ github.workflow }}-${{ github.ref }}
|
|
10
|
+
cancel-in-progress: true
|
|
11
|
+
|
|
12
|
+
permissions:
|
|
13
|
+
contents: read
|
|
14
|
+
|
|
15
|
+
jobs:
|
|
16
|
+
test:
|
|
17
|
+
runs-on: ubuntu-latest
|
|
18
|
+
strategy:
|
|
19
|
+
matrix:
|
|
20
|
+
python-version: ["3.11", "3.12"]
|
|
21
|
+
steps:
|
|
22
|
+
- uses: actions/checkout@v4
|
|
23
|
+
- uses: astral-sh/setup-uv@v4
|
|
24
|
+
with:
|
|
25
|
+
enable-cache: true
|
|
26
|
+
- name: Install Python
|
|
27
|
+
run: uv python install ${{ matrix.python-version }}
|
|
28
|
+
- name: Sync dependencies
|
|
29
|
+
run: uv sync --all-extras
|
|
30
|
+
- name: Test
|
|
31
|
+
run: uv run pytest -v --cov --cov-fail-under=79
|
|
32
|
+
|
|
33
|
+
mypy:
|
|
34
|
+
runs-on: ubuntu-latest
|
|
35
|
+
steps:
|
|
36
|
+
- uses: actions/checkout@v4
|
|
37
|
+
- uses: astral-sh/setup-uv@v4
|
|
38
|
+
with:
|
|
39
|
+
enable-cache: true
|
|
40
|
+
- name: Install Python 3.12
|
|
41
|
+
run: uv python install 3.12
|
|
42
|
+
- name: Sync dependencies
|
|
43
|
+
run: uv sync --all-extras
|
|
44
|
+
- name: Type-check
|
|
45
|
+
run: uv run mypy strict_module/
|
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
name: Cleanup Guard
|
|
2
|
+
|
|
3
|
+
on:
|
|
4
|
+
pull_request
|
|
5
|
+
|
|
6
|
+
jobs:
|
|
7
|
+
feature-documentation:
|
|
8
|
+
name: Verify all features have audit and review docs
|
|
9
|
+
runs-on: ubuntu-latest
|
|
10
|
+
steps:
|
|
11
|
+
- uses: actions/checkout@v4
|
|
12
|
+
- name: Check feature documentation completeness
|
|
13
|
+
run: |
|
|
14
|
+
set -e
|
|
15
|
+
|
|
16
|
+
echo "Checking that all strict-module features have audit and review documentation..."
|
|
17
|
+
|
|
18
|
+
FEATURES_DIR="strict_module"
|
|
19
|
+
AUDITS_DIR="docs/strict_module/audits"
|
|
20
|
+
REVIEWS_DIR="docs/strict_module/reviews"
|
|
21
|
+
|
|
22
|
+
if [ ! -d "$FEATURES_DIR" ]; then
|
|
23
|
+
echo "ERROR: Features directory not found: $FEATURES_DIR"
|
|
24
|
+
exit 1
|
|
25
|
+
fi
|
|
26
|
+
|
|
27
|
+
if [ ! -d "$AUDITS_DIR" ]; then
|
|
28
|
+
echo "ERROR: Audits directory not found: $AUDITS_DIR"
|
|
29
|
+
exit 1
|
|
30
|
+
fi
|
|
31
|
+
|
|
32
|
+
if [ ! -d "$REVIEWS_DIR" ]; then
|
|
33
|
+
echo "ERROR: Reviews directory not found: $REVIEWS_DIR"
|
|
34
|
+
exit 1
|
|
35
|
+
fi
|
|
36
|
+
|
|
37
|
+
FEATURES=("linter-rules-engine" "loc-cap-subcommand" "cli" "config-layer")
|
|
38
|
+
MISSING_DOCS=0
|
|
39
|
+
|
|
40
|
+
for feature in "${FEATURES[@]}"; do
|
|
41
|
+
audit_file=$(find "$AUDITS_DIR" -name "*$feature*audit*" 2>/dev/null | head -1)
|
|
42
|
+
review_file=$(find "$REVIEWS_DIR" -name "*$feature*review*" 2>/dev/null | head -1)
|
|
43
|
+
|
|
44
|
+
if [ -z "$audit_file" ]; then
|
|
45
|
+
echo "FAIL: Feature '$feature' missing audit doc in docs/strict_module/audits"
|
|
46
|
+
MISSING_DOCS=$((MISSING_DOCS + 1))
|
|
47
|
+
fi
|
|
48
|
+
|
|
49
|
+
if [ -z "$review_file" ]; then
|
|
50
|
+
echo "FAIL: Feature '$feature' missing review doc in docs/strict_module/reviews"
|
|
51
|
+
MISSING_DOCS=$((MISSING_DOCS + 1))
|
|
52
|
+
fi
|
|
53
|
+
done
|
|
54
|
+
|
|
55
|
+
if [ $MISSING_DOCS -gt 0 ]; then
|
|
56
|
+
echo ""
|
|
57
|
+
echo "ERROR: $MISSING_DOCS feature(s) missing documentation."
|
|
58
|
+
echo "Each feature must have:"
|
|
59
|
+
echo " - docs/strict_module/audits/*<feature>*audit*.md"
|
|
60
|
+
echo " - docs/strict_module/reviews/*<feature>*review*.md"
|
|
61
|
+
exit 1
|
|
62
|
+
fi
|
|
63
|
+
|
|
64
|
+
echo "✓ All strict-module features have corresponding audit and review docs."
|
|
@@ -0,0 +1,73 @@
|
|
|
1
|
+
name: Attribution Gate
|
|
2
|
+
|
|
3
|
+
# Server-side enforcement: rejects pushes/PRs whose commit messages contain
|
|
4
|
+
# Claude/Anthropic attribution. Catches GitHub squash-merge propagation that
|
|
5
|
+
# bypasses local commit-msg, pre-push, and PreToolUse hooks.
|
|
6
|
+
#
|
|
7
|
+
# Per-repo copy of the canonical attribution gate.
|
|
8
|
+
|
|
9
|
+
on:
|
|
10
|
+
push:
|
|
11
|
+
pull_request:
|
|
12
|
+
|
|
13
|
+
permissions:
|
|
14
|
+
contents: read
|
|
15
|
+
pull-requests: read
|
|
16
|
+
|
|
17
|
+
jobs:
|
|
18
|
+
scan:
|
|
19
|
+
name: Scan commit messages for attribution
|
|
20
|
+
runs-on: ubuntu-latest
|
|
21
|
+
steps:
|
|
22
|
+
- name: Checkout (full history)
|
|
23
|
+
uses: actions/checkout@v4
|
|
24
|
+
with:
|
|
25
|
+
fetch-depth: 0
|
|
26
|
+
|
|
27
|
+
- name: Determine commit range
|
|
28
|
+
id: range
|
|
29
|
+
env:
|
|
30
|
+
EVENT_NAME: ${{ github.event_name }}
|
|
31
|
+
PR_BASE: ${{ github.event.pull_request.base.sha }}
|
|
32
|
+
PR_HEAD: ${{ github.event.pull_request.head.sha }}
|
|
33
|
+
PUSH_BEFORE: ${{ github.event.before }}
|
|
34
|
+
PUSH_AFTER: ${{ github.event.after }}
|
|
35
|
+
run: |
|
|
36
|
+
set -euo pipefail
|
|
37
|
+
if [ "$EVENT_NAME" = "pull_request" ]; then
|
|
38
|
+
BASE="$PR_BASE"
|
|
39
|
+
HEAD="$PR_HEAD"
|
|
40
|
+
else
|
|
41
|
+
BASE="$PUSH_BEFORE"
|
|
42
|
+
HEAD="$PUSH_AFTER"
|
|
43
|
+
if [ "$BASE" = "0000000000000000000000000000000000000000" ] || [ -z "$BASE" ]; then
|
|
44
|
+
git fetch origin main:refs/remotes/origin/main 2>/dev/null || true
|
|
45
|
+
BASE=$(git merge-base origin/main "$HEAD" 2>/dev/null || git rev-list --max-parents=0 "$HEAD" | tail -1)
|
|
46
|
+
fi
|
|
47
|
+
fi
|
|
48
|
+
echo "base=$BASE" >> "$GITHUB_OUTPUT"
|
|
49
|
+
echo "head=$HEAD" >> "$GITHUB_OUTPUT"
|
|
50
|
+
|
|
51
|
+
- name: Scan for Claude/Anthropic attribution
|
|
52
|
+
env:
|
|
53
|
+
BASE: ${{ steps.range.outputs.base }}
|
|
54
|
+
HEAD: ${{ steps.range.outputs.head }}
|
|
55
|
+
PATTERN: 'co-authored-by.*(claude|anthropic)|generated with claude|@claude|noreply@anthropic|🤖'
|
|
56
|
+
run: |
|
|
57
|
+
set -uo pipefail
|
|
58
|
+
OFFENDING=""
|
|
59
|
+
for sha in $(git rev-list "$BASE..$HEAD"); do
|
|
60
|
+
MSG=$(git log -1 --pretty=format:"%B" "$sha")
|
|
61
|
+
if echo "$MSG" | grep -qiE "$PATTERN"; then
|
|
62
|
+
AUTHOR=$(git log -1 --pretty=format:"%an" "$sha")
|
|
63
|
+
SUBJECT=$(git log -1 --pretty=format:"%s" "$sha")
|
|
64
|
+
OFFENDING="${OFFENDING} ${sha:0:8} | author=${AUTHOR} | ${SUBJECT}"$'\n'
|
|
65
|
+
fi
|
|
66
|
+
done
|
|
67
|
+
if [ -n "$OFFENDING" ]; then
|
|
68
|
+
echo "::error::Claude/Anthropic attribution detected in commit messages"
|
|
69
|
+
echo "Offending commits in range $BASE..$HEAD:"
|
|
70
|
+
printf '%s' "$OFFENDING"
|
|
71
|
+
exit 1
|
|
72
|
+
fi
|
|
73
|
+
echo "OK: no attribution detected in $BASE..$HEAD"
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
name: Prose Dash Gate
|
|
2
|
+
|
|
3
|
+
# Scans markdown files for banned em-dashes (U+2014) and en-dashes (U+2013).
|
|
4
|
+
# Box-drawing characters (U+2500-series) do not match this pattern and pass through.
|
|
5
|
+
# This gate prevents recurring manual sweeps by automating the catch at PR-time.
|
|
6
|
+
|
|
7
|
+
on:
|
|
8
|
+
pull_request:
|
|
9
|
+
push:
|
|
10
|
+
branches: [main]
|
|
11
|
+
|
|
12
|
+
concurrency:
|
|
13
|
+
group: ${{ github.workflow }}-${{ github.ref }}
|
|
14
|
+
cancel-in-progress: true
|
|
15
|
+
|
|
16
|
+
permissions:
|
|
17
|
+
contents: read
|
|
18
|
+
|
|
19
|
+
jobs:
|
|
20
|
+
scan:
|
|
21
|
+
name: Scan markdown for banned dashes
|
|
22
|
+
runs-on: ubuntu-latest
|
|
23
|
+
steps:
|
|
24
|
+
- uses: actions/checkout@v4
|
|
25
|
+
- name: Check for em-dashes and en-dashes in markdown
|
|
26
|
+
run: |
|
|
27
|
+
set -uo pipefail
|
|
28
|
+
if grep -rPn '\x{2014}|\x{2013}' --include='*.md' . 2>/dev/null; then
|
|
29
|
+
echo "::error::Em-dashes (U+2014) or en-dashes (U+2013) found in markdown. Replace with commas or periods."
|
|
30
|
+
exit 1
|
|
31
|
+
fi
|
|
32
|
+
echo "OK: no em-dashes or en-dashes in markdown"
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
name: Publish to PyPI
|
|
2
|
+
|
|
3
|
+
on:
|
|
4
|
+
release:
|
|
5
|
+
types: [published]
|
|
6
|
+
|
|
7
|
+
jobs:
|
|
8
|
+
publish:
|
|
9
|
+
name: Build + publish
|
|
10
|
+
runs-on: ubuntu-latest
|
|
11
|
+
environment: pypi # second-layer GitHub deployment-environment gate
|
|
12
|
+
permissions:
|
|
13
|
+
id-token: write # OIDC trusted publisher
|
|
14
|
+
contents: read
|
|
15
|
+
|
|
16
|
+
steps:
|
|
17
|
+
- name: Checkout
|
|
18
|
+
uses: actions/checkout@v4
|
|
19
|
+
|
|
20
|
+
- name: Set up Python
|
|
21
|
+
uses: actions/setup-python@v5
|
|
22
|
+
with:
|
|
23
|
+
python-version: '3.12'
|
|
24
|
+
|
|
25
|
+
- name: Install build deps
|
|
26
|
+
run: python -m pip install --upgrade build
|
|
27
|
+
|
|
28
|
+
- name: Build sdist + wheel
|
|
29
|
+
run: python -m build
|
|
30
|
+
|
|
31
|
+
- name: Verify artifacts
|
|
32
|
+
run: python -m pip install --upgrade twine && python -m twine check dist/*
|
|
33
|
+
|
|
34
|
+
- name: Publish to PyPI
|
|
35
|
+
uses: pypa/gh-action-pypi-publish@release/v1
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
name: Ruff
|
|
2
|
+
|
|
3
|
+
# Ruff lint + format check. Pinned to 0.15.14 to match local version.
|
|
4
|
+
# Format drift was previously undetected; this gate prevents future drift.
|
|
5
|
+
|
|
6
|
+
on:
|
|
7
|
+
pull_request:
|
|
8
|
+
push:
|
|
9
|
+
branches: [main]
|
|
10
|
+
|
|
11
|
+
concurrency:
|
|
12
|
+
group: ${{ github.workflow }}-${{ github.ref }}
|
|
13
|
+
cancel-in-progress: true
|
|
14
|
+
|
|
15
|
+
permissions:
|
|
16
|
+
contents: read
|
|
17
|
+
|
|
18
|
+
jobs:
|
|
19
|
+
ruff:
|
|
20
|
+
runs-on: ubuntu-latest
|
|
21
|
+
steps:
|
|
22
|
+
- uses: actions/checkout@v4
|
|
23
|
+
- uses: astral-sh/setup-uv@v4
|
|
24
|
+
with:
|
|
25
|
+
enable-cache: true
|
|
26
|
+
- name: Ruff lint
|
|
27
|
+
run: uvx ruff@0.15.14 check strict_module/
|
|
28
|
+
- name: Ruff format check
|
|
29
|
+
run: uvx ruff@0.15.14 format --check strict_module/
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
name: Strict Module
|
|
2
|
+
|
|
3
|
+
# DTO-discipline lint (frozen+slots, facade-ban, R001-R006). Per-repo copy of
|
|
4
|
+
# the canonical gate; runs on the strict-module package itself (self-lint).
|
|
5
|
+
# Lint step: source directory only.
|
|
6
|
+
|
|
7
|
+
on:
|
|
8
|
+
pull_request:
|
|
9
|
+
push:
|
|
10
|
+
branches: [main]
|
|
11
|
+
|
|
12
|
+
concurrency:
|
|
13
|
+
group: ${{ github.workflow }}-${{ github.ref }}
|
|
14
|
+
cancel-in-progress: true
|
|
15
|
+
|
|
16
|
+
permissions:
|
|
17
|
+
contents: read
|
|
18
|
+
|
|
19
|
+
jobs:
|
|
20
|
+
lint:
|
|
21
|
+
runs-on: ubuntu-latest
|
|
22
|
+
steps:
|
|
23
|
+
- uses: actions/checkout@v4
|
|
24
|
+
- uses: astral-sh/setup-uv@v4
|
|
25
|
+
with:
|
|
26
|
+
enable-cache: true
|
|
27
|
+
- name: Install Python 3.12
|
|
28
|
+
run: uv python install 3.12
|
|
29
|
+
- name: Run strict-module
|
|
30
|
+
run: |
|
|
31
|
+
uv run --python 3.12 python -m strict_module.cli \
|
|
32
|
+
strict_module/__init__.py \
|
|
33
|
+
strict_module/checkers.py \
|
|
34
|
+
strict_module/cli.py \
|
|
35
|
+
strict_module/config/ \
|
|
36
|
+
strict_module/linter.py \
|
|
37
|
+
strict_module/loc_cap.py \
|
|
38
|
+
strict_module/rules.py \
|
|
39
|
+
--format github
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
# Virtual environments
|
|
2
|
+
.venv/
|
|
3
|
+
.env
|
|
4
|
+
|
|
5
|
+
# Python artifacts
|
|
6
|
+
__pycache__/
|
|
7
|
+
*.py[cod]
|
|
8
|
+
*$py.class
|
|
9
|
+
*.so
|
|
10
|
+
.Python
|
|
11
|
+
|
|
12
|
+
# Distribution / packaging
|
|
13
|
+
build/
|
|
14
|
+
develop-eggs/
|
|
15
|
+
dist/
|
|
16
|
+
downloads/
|
|
17
|
+
eggs/
|
|
18
|
+
.eggs/
|
|
19
|
+
lib/
|
|
20
|
+
lib64/
|
|
21
|
+
parts/
|
|
22
|
+
sdist/
|
|
23
|
+
var/
|
|
24
|
+
wheels/
|
|
25
|
+
*.egg-info/
|
|
26
|
+
.installed.cfg
|
|
27
|
+
*.egg
|
|
28
|
+
|
|
29
|
+
# Testing
|
|
30
|
+
.pytest_cache/
|
|
31
|
+
.coverage
|
|
32
|
+
htmlcov/
|
|
33
|
+
.tox/
|
|
34
|
+
.hypothesis/
|
|
35
|
+
|
|
36
|
+
# IDEs
|
|
37
|
+
.vscode/
|
|
38
|
+
.idea/
|
|
39
|
+
*.swp
|
|
40
|
+
*.swo
|
|
41
|
+
*~
|
|
42
|
+
|
|
43
|
+
# OS
|
|
44
|
+
.DS_Store
|
|
45
|
+
.AppleDouble
|
|
46
|
+
.LSOverride
|
|
47
|
+
|
|
48
|
+
# Project-specific
|
|
49
|
+
.strict-module-baseline.json
|
|
50
|
+
.dto-strict-baseline.json
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
# Changelog
|
|
2
|
+
|
|
3
|
+
All notable changes to this project will be documented in this file.
|
|
4
|
+
|
|
5
|
+
## [Unreleased]
|
|
6
|
+
|
|
7
|
+
_No changes yet._
|
|
8
|
+
|
|
9
|
+
## [0.1.0] - 2026-07-10
|
|
10
|
+
|
|
11
|
+
### Added
|
|
12
|
+
|
|
13
|
+
- **Monorepo consolidation** - Consolidated strict-module 0.5.0 into the strict-suite monorepo. Package import root (`strict_module`) and CLI entry points (`strict-module`, `dto-strict`) remain unchanged.
|
|
14
|
+
- **R007 rule** - Pytest fixtures defined outside conftest.py are now flagged as violations.
|
|
15
|
+
- **R008 rule** - Bare module-level test functions (not in Test<Concern> classes) are now flagged as violations.
|
|
16
|
+
- **LOC cap subcommand** - `strict-module loc-cap` and `dto-strict loc-cap` enforce lines-of-code limits with configurable hard caps and soft targets.
|
|
17
|
+
- **Backward-compatible configuration** - Both `[tool.strict-module]` and legacy `[tool.dto-strict]` config sections are supported.
|
|
18
|
+
|
|
19
|
+
---
|
|
20
|
+
|
|
21
|
+
## Historical Changelog
|
|
22
|
+
|
|
23
|
+
For strict-module v0.1.0-v0.5.0 release history, see [CHANGELOG-history.md](docs/strict_module/CHANGELOG-history.md).
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
# Code of Conduct
|
|
2
|
+
|
|
3
|
+
## My Commitment
|
|
4
|
+
|
|
5
|
+
I maintain this project solo, and I am committed to keeping it a welcoming space for everyone who participates in issues, pull requests, and discussions. I pledge to treat every participant with respect and dignity, regardless of age, body size, caste, disability, ethnicity, sex characteristics, gender, level of experience, education, socio-economic status, nationality, personal appearance, race, religion, sexual identity and orientation, or any other dimension of diversity.
|
|
6
|
+
|
|
7
|
+
## Standards
|
|
8
|
+
|
|
9
|
+
Behavior that keeps this a positive space:
|
|
10
|
+
|
|
11
|
+
- Welcoming and inclusive language
|
|
12
|
+
- Respect for differing viewpoints and experiences
|
|
13
|
+
- Gracefully accepting constructive criticism
|
|
14
|
+
- Focusing on what is best for the project
|
|
15
|
+
- Empathy toward other participants
|
|
16
|
+
|
|
17
|
+
Behavior I will not accept:
|
|
18
|
+
|
|
19
|
+
- Harassment or insulting or derogatory comments
|
|
20
|
+
- Personal attacks
|
|
21
|
+
- Public or private harassment
|
|
22
|
+
- Publishing someone's private information without consent
|
|
23
|
+
- Conduct that could reasonably be considered inappropriate
|
|
24
|
+
|
|
25
|
+
## Enforcement
|
|
26
|
+
|
|
27
|
+
Report unacceptable behavior to me through GitHub, either by opening an issue or, where discretion is warranted, through private vulnerability reporting. I review and act on every report promptly and fairly, and I respect the privacy and security of anyone who reports.
|
|
28
|
+
|
|
29
|
+
## Attribution
|
|
30
|
+
|
|
31
|
+
This Code of Conduct is adapted from the Contributor Covenant, version 2.1, available at https://www.contributor-covenant.org/version/2/1/code_of_conduct.html.
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
# Contributing
|
|
2
|
+
|
|
3
|
+
Issues and pull requests welcome. Please include fixtures (good and bad examples) for new rules.
|
|
4
|
+
|
|
5
|
+
When submitting a fix or feature:
|
|
6
|
+
|
|
7
|
+
1. Ensure all tests pass: `python3.12 -m pytest strict_module/tests/ -v --tb=short`
|
|
8
|
+
2. Format code: `ruff format strict_module/`
|
|
9
|
+
3. Lint code: `ruff check strict_module/` and `strict-module strict_module/`
|
|
10
|
+
4. Check LOC caps: `strict-module loc-cap strict_module/`
|
|
11
|
+
5. Update CHANGELOG.md with your changes under an [Unreleased] section
|
|
12
|
+
|
|
13
|
+
## Development Setup
|
|
14
|
+
|
|
15
|
+
```bash
|
|
16
|
+
git clone https://github.com/jekhator/strict-suite.git
|
|
17
|
+
cd strict-suite
|
|
18
|
+
python3.12 -m venv .venv
|
|
19
|
+
source .venv/bin/activate
|
|
20
|
+
pip install -e ".[dev]"
|
|
21
|
+
```
|
|
22
|
+
|
|
23
|
+
## Running Tests
|
|
24
|
+
|
|
25
|
+
```bash
|
|
26
|
+
python3.12 -m pytest tests/ -v
|
|
27
|
+
```
|
|
28
|
+
|
|
29
|
+
## License
|
|
30
|
+
|
|
31
|
+
All contributions are licensed under the Apache License 2.0. See LICENSE for details.
|
|
@@ -0,0 +1,201 @@
|
|
|
1
|
+
Apache License
|
|
2
|
+
Version 2.0, January 2004
|
|
3
|
+
http://www.apache.org/licenses/
|
|
4
|
+
|
|
5
|
+
TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
|
|
6
|
+
|
|
7
|
+
1. Definitions.
|
|
8
|
+
|
|
9
|
+
"License" shall mean the terms and conditions for use, reproduction,
|
|
10
|
+
and distribution as defined by Sections 1 through 9 of this document.
|
|
11
|
+
|
|
12
|
+
"Licensor" shall mean the copyright owner or entity authorized by
|
|
13
|
+
the copyright owner that is granting the License.
|
|
14
|
+
|
|
15
|
+
"Legal Entity" shall mean the union of the acting entity and all
|
|
16
|
+
other entities that control, are controlled by, or are under common
|
|
17
|
+
control with that entity. For the purposes of this definition,
|
|
18
|
+
"control" means (i) the power, direct or indirect, to cause the
|
|
19
|
+
direction or management of such entity, whether by contract or
|
|
20
|
+
otherwise, or (ii) ownership of fifty percent (50%) or more of the
|
|
21
|
+
outstanding shares, or (iii) beneficial ownership of such entity.
|
|
22
|
+
|
|
23
|
+
"You" (or "Your") shall mean an individual or Legal Entity
|
|
24
|
+
exercising permissions granted by this License.
|
|
25
|
+
|
|
26
|
+
"Source" form shall mean the preferred form for making modifications,
|
|
27
|
+
including but not limited to software source code, documentation
|
|
28
|
+
source, and configuration files.
|
|
29
|
+
|
|
30
|
+
"Object" form shall mean any form resulting from mechanical
|
|
31
|
+
transformation or translation of a Source form, including but
|
|
32
|
+
not limited to compiled object code, generated documentation,
|
|
33
|
+
and conversions to other media types.
|
|
34
|
+
|
|
35
|
+
"Work" shall mean the work of authorship, whether in Source or
|
|
36
|
+
Object form, made available under the License, as indicated by a
|
|
37
|
+
copyright notice that is included in or attached to the work
|
|
38
|
+
(an example is provided in the Appendix below).
|
|
39
|
+
|
|
40
|
+
"Derivative Works" shall mean any work, whether in Source or Object
|
|
41
|
+
form, that is based on (or derived from) the Work and for which the
|
|
42
|
+
editorial revisions, annotations, elaborations, or other modifications
|
|
43
|
+
represent, as a whole, an original work of authorship. For the purposes
|
|
44
|
+
of this License, Derivative Works shall not include works that remain
|
|
45
|
+
separable from, or merely link (or bind by name) to the interfaces of,
|
|
46
|
+
the Work and Derivative Works thereof.
|
|
47
|
+
|
|
48
|
+
"Contribution" shall mean any work of authorship, including
|
|
49
|
+
the original version of the Work and any modifications or additions
|
|
50
|
+
to that Work or Derivative Works thereof, that is intentionally
|
|
51
|
+
submitted to Licensor for inclusion in the Work by the copyright owner
|
|
52
|
+
or by an individual or Legal Entity authorized to submit on behalf of
|
|
53
|
+
the copyright owner. For the purposes of this definition, "submitted"
|
|
54
|
+
means any form of electronic, verbal, or written communication sent
|
|
55
|
+
to the Licensor or its representatives, including but not limited to
|
|
56
|
+
communication on electronic mailing lists, source code control systems,
|
|
57
|
+
and issue tracking systems that are managed by, or on behalf of, the
|
|
58
|
+
Licensor for the purpose of discussing and improving the Work, but
|
|
59
|
+
excluding communication that is conspicuously marked or otherwise
|
|
60
|
+
designated in writing by the copyright owner as "Not a Contribution."
|
|
61
|
+
|
|
62
|
+
"Contributor" shall mean Licensor and any individual or Legal Entity
|
|
63
|
+
on behalf of whom a Contribution has been received by Licensor and
|
|
64
|
+
subsequently incorporated within the Work.
|
|
65
|
+
|
|
66
|
+
2. Grant of Copyright License. Subject to the terms and conditions of
|
|
67
|
+
this License, each Contributor hereby grants to You a perpetual,
|
|
68
|
+
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
|
69
|
+
copyright license to reproduce, prepare Derivative Works of,
|
|
70
|
+
publicly display, publicly perform, sublicense, and distribute the
|
|
71
|
+
Work and such Derivative Works in Source or Object form.
|
|
72
|
+
|
|
73
|
+
3. Grant of Patent License. Subject to the terms and conditions of
|
|
74
|
+
this License, each Contributor hereby grants to You a perpetual,
|
|
75
|
+
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
|
76
|
+
(except as stated in this section) patent license to make, have made,
|
|
77
|
+
use, offer to sell, sell, import, and otherwise transfer the Work,
|
|
78
|
+
where such license applies only to those patent claims licensable
|
|
79
|
+
by such Contributor that are necessarily infringed by their
|
|
80
|
+
Contribution(s) alone or by combination of their Contribution(s)
|
|
81
|
+
with the Work to which such Contribution(s) was submitted. If You
|
|
82
|
+
institute patent litigation against any entity (including a
|
|
83
|
+
cross-claim or counterclaim in a lawsuit) alleging that the Work
|
|
84
|
+
or a Contribution incorporated within the Work constitutes direct
|
|
85
|
+
or contributory patent infringement, then any patent licenses
|
|
86
|
+
granted to You under this License for that Work shall terminate
|
|
87
|
+
as of the date such litigation is filed.
|
|
88
|
+
|
|
89
|
+
4. Redistribution. You may reproduce and distribute copies of the
|
|
90
|
+
Work or Derivative Works thereof in any medium, with or without
|
|
91
|
+
modifications, and in Source or Object form, provided that You
|
|
92
|
+
meet the following conditions:
|
|
93
|
+
|
|
94
|
+
(a) You must give any other recipients of the Work or
|
|
95
|
+
Derivative Works a copy of this License; and
|
|
96
|
+
|
|
97
|
+
(b) You must cause any modified files to carry prominent notices
|
|
98
|
+
stating that You changed the files; and
|
|
99
|
+
|
|
100
|
+
(c) You must retain, in the Source form of any Derivative Works
|
|
101
|
+
that You distribute, all copyright, patent, trademark, and
|
|
102
|
+
attribution notices from the Source form of the Work,
|
|
103
|
+
excluding those notices that do not pertain to any part of
|
|
104
|
+
the Derivative Works; and
|
|
105
|
+
|
|
106
|
+
(d) If the Work includes a "NOTICE" text file as part of its
|
|
107
|
+
distribution, then any Derivative Works that You distribute must
|
|
108
|
+
include a readable copy of the attribution notices contained
|
|
109
|
+
within such NOTICE file, excluding those notices that do not
|
|
110
|
+
pertain to any part of the Derivative Works, in at least one
|
|
111
|
+
of the following places: within a NOTICE text file distributed
|
|
112
|
+
as part of the Derivative Works; within the Source form or
|
|
113
|
+
documentation, if provided along with the Derivative Works; or,
|
|
114
|
+
within a display generated by the Derivative Works, if and
|
|
115
|
+
wherever such third-party notices normally appear. The contents
|
|
116
|
+
of the NOTICE file are for informational purposes only and
|
|
117
|
+
do not modify the License. You may add Your own attribution
|
|
118
|
+
notices within Derivative Works that You distribute, alongside
|
|
119
|
+
or as an addendum to the NOTICE text from the Work, provided
|
|
120
|
+
that such additional attribution notices cannot be construed
|
|
121
|
+
as modifying the License.
|
|
122
|
+
|
|
123
|
+
You may add Your own copyright statement to Your modifications and
|
|
124
|
+
may provide additional or different license terms and conditions
|
|
125
|
+
for use, reproduction, or distribution of Your modifications, or
|
|
126
|
+
for any such Derivative Works as a whole, provided Your use,
|
|
127
|
+
reproduction, and distribution of the Work otherwise complies with
|
|
128
|
+
the conditions stated in this License.
|
|
129
|
+
|
|
130
|
+
5. Submission of Contributions. Unless You explicitly state otherwise,
|
|
131
|
+
any Contribution intentionally submitted for inclusion in the Work
|
|
132
|
+
by You to the Licensor shall be under the terms and conditions of
|
|
133
|
+
this License, without any additional terms or conditions.
|
|
134
|
+
Notwithstanding the above, nothing herein shall supersede or modify
|
|
135
|
+
the terms of any separate license agreement you may have executed
|
|
136
|
+
with Licensor regarding such Contributions.
|
|
137
|
+
|
|
138
|
+
6. Trademarks. This License does not grant permission to use the trade
|
|
139
|
+
names, trademarks, service marks, or product names of the Licensor,
|
|
140
|
+
except as required for reasonable and customary use in describing the
|
|
141
|
+
origin of the Work and reproducing the content of the NOTICE file.
|
|
142
|
+
|
|
143
|
+
7. Disclaimer of Warranty. Unless required by applicable law or
|
|
144
|
+
agreed to in writing, Licensor provides the Work (and each
|
|
145
|
+
Contributor provides its Contributions) on an "AS IS" BASIS,
|
|
146
|
+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
|
|
147
|
+
implied, including, without limitation, any warranties or conditions
|
|
148
|
+
of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
|
|
149
|
+
PARTICULAR PURPOSE. You are solely responsible for determining the
|
|
150
|
+
appropriateness of using or redistributing the Work and assume any
|
|
151
|
+
risks associated with Your exercise of permissions under this License.
|
|
152
|
+
|
|
153
|
+
8. Limitation of Liability. In no event and under no legal theory,
|
|
154
|
+
whether in tort (including negligence), contract, or otherwise,
|
|
155
|
+
unless required by applicable law (such as deliberate and grossly
|
|
156
|
+
negligent acts) or agreed to in writing, shall any Contributor be
|
|
157
|
+
liable to You for damages, including any direct, indirect, special,
|
|
158
|
+
incidental, or consequential damages of any character arising as a
|
|
159
|
+
result of this License or out of the use or inability to use the
|
|
160
|
+
Work (including but not limited to damages for loss of goodwill,
|
|
161
|
+
work stoppage, computer failure or malfunction, or any and all
|
|
162
|
+
other commercial damages or losses), even if such Contributor
|
|
163
|
+
has been advised of the possibility of such damages.
|
|
164
|
+
|
|
165
|
+
9. Accepting Warranty or Additional Liability. While redistributing
|
|
166
|
+
the Work or Derivative Works thereof, You may choose to offer,
|
|
167
|
+
and charge a fee for, acceptance of support, warranty, indemnity,
|
|
168
|
+
or other liability obligations and/or rights consistent with this
|
|
169
|
+
License. However, in accepting such obligations, You may act only
|
|
170
|
+
on Your own behalf and on Your sole responsibility, not on behalf
|
|
171
|
+
of any other Contributor, and only if You agree to indemnify,
|
|
172
|
+
defend, and hold each Contributor harmless for any liability
|
|
173
|
+
incurred by, or claims asserted against, such Contributor by reason
|
|
174
|
+
of your accepting any such warranty or additional liability.
|
|
175
|
+
|
|
176
|
+
END OF TERMS AND CONDITIONS
|
|
177
|
+
|
|
178
|
+
APPENDIX: How to apply the Apache License to your work.
|
|
179
|
+
|
|
180
|
+
To apply the Apache License to your work, attach the following
|
|
181
|
+
boilerplate notice, with the fields enclosed by brackets "[]"
|
|
182
|
+
replaced with your own identifying information. (Don't include
|
|
183
|
+
the brackets!) The text should be enclosed in the appropriate
|
|
184
|
+
comment syntax for the file format. We also recommend that a
|
|
185
|
+
file or class name and description of purpose be included on the
|
|
186
|
+
same "printed page" as the copyright notice for easier
|
|
187
|
+
identification within third-party archives.
|
|
188
|
+
|
|
189
|
+
Copyright 2026 James Ekhator
|
|
190
|
+
|
|
191
|
+
Licensed under the Apache License, Version 2.0 (the "License");
|
|
192
|
+
you may not use this file except in compliance with the License.
|
|
193
|
+
You may obtain a copy of the License at
|
|
194
|
+
|
|
195
|
+
http://www.apache.org/licenses/LICENSE-2.0
|
|
196
|
+
|
|
197
|
+
Unless required by applicable law or agreed to in writing, software
|
|
198
|
+
distributed under the License is distributed on an "AS IS" BASIS,
|
|
199
|
+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
200
|
+
See the License for the specific language governing permissions and
|
|
201
|
+
limitations under the License.
|