agentslint 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.
Files changed (72) hide show
  1. agentslint-0.1.0/.github/ISSUE_TEMPLATE/bug_report.yml +88 -0
  2. agentslint-0.1.0/.github/ISSUE_TEMPLATE/config.yml +1 -0
  3. agentslint-0.1.0/.github/ISSUE_TEMPLATE/feature_request.yml +77 -0
  4. agentslint-0.1.0/.github/PULL_REQUEST_TEMPLATE.md +15 -0
  5. agentslint-0.1.0/.github/workflows/check.yml +33 -0
  6. agentslint-0.1.0/.github/workflows/ci_cd.yaml +123 -0
  7. agentslint-0.1.0/.gitignore +13 -0
  8. agentslint-0.1.0/.pre-commit-config.yaml +33 -0
  9. agentslint-0.1.0/.yamllint.yaml +10 -0
  10. agentslint-0.1.0/AGENTS.md +58 -0
  11. agentslint-0.1.0/LICENSE +21 -0
  12. agentslint-0.1.0/Makefile +61 -0
  13. agentslint-0.1.0/PKG-INFO +154 -0
  14. agentslint-0.1.0/README.md +130 -0
  15. agentslint-0.1.0/docs/adding-a-resolver.md +233 -0
  16. agentslint-0.1.0/docs/configuration.md +48 -0
  17. agentslint-0.1.0/docs/github-actions.md +30 -0
  18. agentslint-0.1.0/docs/how-it-works.md +114 -0
  19. agentslint-0.1.0/pyproject.toml +94 -0
  20. agentslint-0.1.0/src/agentslint/__init__.py +7 -0
  21. agentslint-0.1.0/src/agentslint/__main__.py +5 -0
  22. agentslint-0.1.0/src/agentslint/cli.py +51 -0
  23. agentslint-0.1.0/src/agentslint/config.py +251 -0
  24. agentslint-0.1.0/src/agentslint/diagnostics.py +116 -0
  25. agentslint-0.1.0/src/agentslint/discovery.py +168 -0
  26. agentslint-0.1.0/src/agentslint/engine.py +119 -0
  27. agentslint-0.1.0/src/agentslint/markdown.py +817 -0
  28. agentslint-0.1.0/src/agentslint/models.py +59 -0
  29. agentslint-0.1.0/src/agentslint/resolvers/__init__.py +4 -0
  30. agentslint-0.1.0/src/agentslint/resolvers/base.py +40 -0
  31. agentslint-0.1.0/src/agentslint/resolvers/dbt.py +239 -0
  32. agentslint-0.1.0/src/agentslint/resolvers/go.py +186 -0
  33. agentslint-0.1.0/src/agentslint/resolvers/links.py +64 -0
  34. agentslint-0.1.0/src/agentslint/resolvers/make.py +126 -0
  35. agentslint-0.1.0/src/agentslint/resolvers/npm.py +354 -0
  36. agentslint-0.1.0/src/agentslint/resolvers/paths.py +228 -0
  37. agentslint-0.1.0/src/agentslint/resolvers/project.py +72 -0
  38. agentslint-0.1.0/src/agentslint/resolvers/pytest.py +137 -0
  39. agentslint-0.1.0/src/agentslint/resolvers/python.py +294 -0
  40. agentslint-0.1.0/src/agentslint/resolvers/shell.py +316 -0
  41. agentslint-0.1.0/src/agentslint/resolvers/tools.py +202 -0
  42. agentslint-0.1.0/src/agentslint/workspace.py +93 -0
  43. agentslint-0.1.0/tests/conftest.py +22 -0
  44. agentslint-0.1.0/tests/fixtures/e2e/invalid/AGENTS.md +13 -0
  45. agentslint-0.1.0/tests/fixtures/e2e/invalid/Makefile +3 -0
  46. agentslint-0.1.0/tests/fixtures/e2e/invalid/pyproject.toml +4 -0
  47. agentslint-0.1.0/tests/fixtures/e2e/invalid/services/frontend/AGENTS.md +3 -0
  48. agentslint-0.1.0/tests/fixtures/e2e/valid/AGENTS.md +15 -0
  49. agentslint-0.1.0/tests/fixtures/e2e/valid/Makefile +3 -0
  50. agentslint-0.1.0/tests/fixtures/e2e/valid/checks/example.py +2 -0
  51. agentslint-0.1.0/tests/fixtures/e2e/valid/docs/development.md +3 -0
  52. agentslint-0.1.0/tests/fixtures/e2e/valid/pyproject.toml +4 -0
  53. agentslint-0.1.0/tests/fixtures/e2e/valid/scripts/check.py +1 -0
  54. agentslint-0.1.0/tests/fixtures/e2e/valid/services/frontend/AGENTS.md +7 -0
  55. agentslint-0.1.0/tests/fixtures/e2e/valid/services/frontend/docs/development.md +3 -0
  56. agentslint-0.1.0/tests/fixtures/e2e/valid/services/frontend/package.json +7 -0
  57. agentslint-0.1.0/tests/fixtures/e2e/valid/services/frontend/src/app.ts +1 -0
  58. agentslint-0.1.0/tests/fixtures/e2e/valid/src/example_app/main.py +2 -0
  59. agentslint-0.1.0/tests/resolvers/test_commands.py +369 -0
  60. agentslint-0.1.0/tests/resolvers/test_edge_cases.py +873 -0
  61. agentslint-0.1.0/tests/resolvers/test_path_edge_cases.py +196 -0
  62. agentslint-0.1.0/tests/resolvers/test_tools.py +169 -0
  63. agentslint-0.1.0/tests/test_cli.py +70 -0
  64. agentslint-0.1.0/tests/test_config.py +170 -0
  65. agentslint-0.1.0/tests/test_discovery.py +139 -0
  66. agentslint-0.1.0/tests/test_e2e_fixtures.py +61 -0
  67. agentslint-0.1.0/tests/test_engine.py +183 -0
  68. agentslint-0.1.0/tests/test_integration.py +204 -0
  69. agentslint-0.1.0/tests/test_lotus_regressions.py +75 -0
  70. agentslint-0.1.0/tests/test_markdown.py +280 -0
  71. agentslint-0.1.0/tests/test_workspace.py +80 -0
  72. agentslint-0.1.0/uv.lock +482 -0
@@ -0,0 +1,88 @@
1
+ name: Bug report
2
+ description: Report an incorrect diagnostic, missed reference, crash, or integration problem.
3
+ title: "[Bug] "
4
+ labels: []
5
+ body:
6
+ - type: markdown
7
+ attributes:
8
+ value: |
9
+ Thanks for helping improve agentslint. Please reduce the report to the smallest safe repository example you can share. Remove secrets and private source content from all logs and snippets.
10
+
11
+ - type: checkboxes
12
+ id: checks
13
+ attributes:
14
+ label: Before submitting
15
+ options:
16
+ - label: I searched existing issues for the same behavior.
17
+ required: true
18
+ - label: I removed secrets, credentials, and private repository content from this report.
19
+ required: true
20
+
21
+ - type: input
22
+ id: version
23
+ attributes:
24
+ label: agentslint version
25
+ description: Provide the installed or pinned package version.
26
+ placeholder: "0.1.0"
27
+ validations:
28
+ required: true
29
+
30
+ - type: input
31
+ id: environment
32
+ attributes:
33
+ label: Environment
34
+ description: Include Python version, operating system, installation method, and whether the target
35
+ is a Git worktree.
36
+ placeholder: "Python 3.12, Ubuntu 24.04, uvx, Git worktree"
37
+ validations:
38
+ required: true
39
+
40
+ - type: textarea
41
+ id: command
42
+ attributes:
43
+ label: Command
44
+ description: Provide the exact command and flags used.
45
+ render: shell
46
+ placeholder: agentslint check . --strict
47
+ validations:
48
+ required: true
49
+
50
+ - type: textarea
51
+ id: fixture
52
+ attributes:
53
+ label: Minimal repository example
54
+ description: Show the relevant AGENTS.md excerpt, directory tree, and manifest fragments. A small
55
+ public reproduction repository is also welcome.
56
+ placeholder: |
57
+ AGENTS.md:
58
+ Run `example check`.
59
+
60
+ Repository:
61
+ AGENTS.md
62
+ example.toml
63
+ validations:
64
+ required: true
65
+
66
+ - type: textarea
67
+ id: actual
68
+ attributes:
69
+ label: Actual behavior
70
+ description: Include the complete diagnostic or traceback after removing sensitive content.
71
+ validations:
72
+ required: true
73
+
74
+ - type: textarea
75
+ id: expected
76
+ attributes:
77
+ label: Expected behavior
78
+ description: Explain what agentslint should have resolved or reported instead.
79
+ validations:
80
+ required: true
81
+
82
+ - type: textarea
83
+ id: context
84
+ attributes:
85
+ label: Additional context
86
+ description: Add anything relevant about project layout, scope markers, configuration, or CI behavior.
87
+ validations:
88
+ required: false
@@ -0,0 +1 @@
1
+ blank_issues_enabled: false
@@ -0,0 +1,77 @@
1
+ name: Feature request
2
+ description: Propose a resolver, reference type, integration, or workflow improvement.
3
+ title: "[Feature] "
4
+ labels: []
5
+ body:
6
+ - type: markdown
7
+ attributes:
8
+ value: |
9
+ agentslint favors static, read-only checks that can be proven from repository content. Concrete examples help determine whether a proposal fits that boundary.
10
+
11
+ - type: checkboxes
12
+ id: checks
13
+ attributes:
14
+ label: Before submitting
15
+ options:
16
+ - label: I searched existing issues for a similar proposal.
17
+ required: true
18
+ - label: This request does not require agentslint to execute documented commands or application
19
+ code.
20
+ required: true
21
+
22
+ - type: dropdown
23
+ id: area
24
+ attributes:
25
+ label: Area
26
+ options:
27
+ - Command resolver
28
+ - Path, link, or Markdown extraction
29
+ - Tool declaration inventory
30
+ - Configuration
31
+ - CLI or output format
32
+ - CI or pre-commit integration
33
+ - Documentation
34
+ - Other
35
+ validations:
36
+ required: true
37
+
38
+ - type: textarea
39
+ id: use_case
40
+ attributes:
41
+ label: Use case
42
+ description: What real AGENTS.md instruction cannot be validated today, and what repository drift
43
+ should agentslint catch?
44
+ placeholder: |
45
+ AGENTS.md contains:
46
+ Run `example verify api`.
47
+
48
+ The repository declares valid tasks in:
49
+ example.toml
50
+ validations:
51
+ required: true
52
+
53
+ - type: textarea
54
+ id: behavior
55
+ attributes:
56
+ label: Proposed behavior
57
+ description: Describe valid, invalid, and ambiguous cases and the diagnostic you would expect.
58
+ validations:
59
+ required: true
60
+
61
+ - type: textarea
62
+ id: evidence
63
+ attributes:
64
+ label: Static evidence
65
+ description: Which tracked files or manifests allow agentslint to resolve this without executing
66
+ a command, importing code, or using the network?
67
+ validations:
68
+ required: true
69
+
70
+ - type: textarea
71
+ id: alternatives
72
+ attributes:
73
+ label: Alternatives considered
74
+ description: Explain current workarounds, narrower checks, or syntax that could make the instruction
75
+ unambiguous.
76
+ validations:
77
+ required: false
@@ -0,0 +1,15 @@
1
+ ## Description
2
+
3
+ Description for the PR
4
+
5
+ ### Added
6
+
7
+ - None
8
+
9
+ ### Updated
10
+
11
+ - None
12
+
13
+ ### Deleted
14
+
15
+ - None
@@ -0,0 +1,33 @@
1
+ name: AGENTS.md Integrity
2
+
3
+ on:
4
+ workflow_call:
5
+ inputs:
6
+ strict:
7
+ description: Fail when agentslint emits warnings
8
+ required: false
9
+ default: false
10
+ type: boolean
11
+
12
+ permissions:
13
+ contents: read # Required by actions/checkout to read repository files.
14
+
15
+ jobs:
16
+ agentslint:
17
+ name: agentslint
18
+ runs-on: ubuntu-latest
19
+ steps:
20
+ - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
21
+ with:
22
+ persist-credentials: false
23
+ - uses: astral-sh/setup-uv@c771a70e6277c0a99b617c7a806ffedaca235ff9 # v9.0.0
24
+ with:
25
+ version: "0.11.16"
26
+ python-version: "3.11"
27
+ enable-cache: true
28
+ - name: Check AGENTS.md references
29
+ if: ${{ !inputs.strict }}
30
+ run: uvx --from agentslint==0.1.0 agentslint check . --format github
31
+ - name: Check AGENTS.md references strictly
32
+ if: ${{ inputs.strict }}
33
+ run: uvx --from agentslint==0.1.0 agentslint check . --format github --strict
@@ -0,0 +1,123 @@
1
+ name: CI/CD
2
+
3
+ on:
4
+ pull_request:
5
+ push:
6
+ branches: [main]
7
+ tags: ["v*"]
8
+
9
+ permissions:
10
+ contents: read # Required by actions/checkout to read repository files.
11
+
12
+ env:
13
+ UV_VERSION: "0.11.16"
14
+ PYTHON_VERSION: "3.11"
15
+
16
+ jobs:
17
+ test:
18
+ name: Python ${{ matrix.python-version }}
19
+ runs-on: ubuntu-latest
20
+ strategy:
21
+ fail-fast: false
22
+ matrix:
23
+ python-version: ["3.11", "3.12", "3.13", "3.14"]
24
+ steps:
25
+ - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
26
+ with:
27
+ persist-credentials: false
28
+ - uses: astral-sh/setup-uv@c771a70e6277c0a99b617c7a806ffedaca235ff9 # v9.0.0
29
+ with:
30
+ version: ${{ env.UV_VERSION }}
31
+ python-version: ${{ matrix.python-version }}
32
+ enable-cache: true
33
+ - run: uv sync --locked --all-groups
34
+ - run: uv run --frozen pytest
35
+
36
+ quality:
37
+ name: Quality
38
+ runs-on: ubuntu-latest
39
+ steps:
40
+ - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
41
+ with:
42
+ persist-credentials: false
43
+ - uses: astral-sh/setup-uv@c771a70e6277c0a99b617c7a806ffedaca235ff9 # v9.0.0
44
+ with:
45
+ version: ${{ env.UV_VERSION }}
46
+ python-version: ${{ env.PYTHON_VERSION }}
47
+ enable-cache: true
48
+ - run: uv sync --locked --all-groups
49
+ - run: uv run --frozen ruff check .
50
+ - run: uv run --frozen ruff format --check .
51
+ - run: uv run --frozen ty check
52
+ - run: uv run --frozen agentslint check . --strict
53
+ - run: uv run --frozen pre-commit run --all-files --show-diff-on-failure
54
+
55
+ build:
56
+ name: Build distribution
57
+ if: ${{ github.event_name == 'pull_request' }} # this also runs on deploy
58
+ needs: [test, quality]
59
+ runs-on: ubuntu-latest
60
+ steps:
61
+ - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
62
+ with:
63
+ persist-credentials: false
64
+ - uses: astral-sh/setup-uv@c771a70e6277c0a99b617c7a806ffedaca235ff9 # v9.0.0
65
+ with:
66
+ version: ${{ env.UV_VERSION }}
67
+ python-version: ${{ env.PYTHON_VERSION }}
68
+ enable-cache: true
69
+ - name: Verify tag matches package version
70
+ if: ${{ startsWith(github.ref, 'refs/tags/') }}
71
+ run: |
72
+ if [[ "v$(uv version --short)" != "$GITHUB_REF_NAME" ]]; then
73
+ echo "Tag $GITHUB_REF_NAME does not match pyproject.toml version $(uv version --short)."
74
+ exit 1
75
+ fi
76
+ - run: uv build
77
+
78
+ deploy:
79
+ name: Publish release
80
+ needs: [test, quality]
81
+ if: ${{ startsWith(github.ref, 'refs/tags/v') }}
82
+ runs-on: ubuntu-latest
83
+ env:
84
+ GH_REPO: ${{ github.repository }}
85
+ environment:
86
+ name: pypi
87
+ url: https://pypi.org/project/agentslint/
88
+ permissions:
89
+ contents: write # Required to create the GitHub release and upload distribution assets.
90
+ id-token: write # Required for PyPI trusted publishing through OIDC.
91
+ steps:
92
+ - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
93
+ with:
94
+ persist-credentials: false
95
+ - uses: astral-sh/setup-uv@c771a70e6277c0a99b617c7a806ffedaca235ff9 # v9.0.0
96
+ with:
97
+ version: ${{ env.UV_VERSION }}
98
+ python-version: ${{ env.PYTHON_VERSION }}
99
+ enable-cache: true
100
+ - name: Build release distributions
101
+ run: uv build
102
+ - name: Create or update draft GitHub release
103
+ env:
104
+ GH_TOKEN: ${{ github.token }}
105
+ run: |
106
+ if gh release view "$GITHUB_REF_NAME" >/dev/null 2>&1; then
107
+ gh release upload "$GITHUB_REF_NAME" dist/* --clobber
108
+ else
109
+ gh release create "$GITHUB_REF_NAME" dist/* --draft --generate-notes --verify-tag
110
+ fi
111
+ - name: Publish distributions
112
+ uses: pypa/gh-action-pypi-publish@ba38be9e461d3875417946c167d0b5f3d385a247 # release/v1
113
+ - name: Publish GitHub release
114
+ env:
115
+ GH_TOKEN: ${{ github.token }}
116
+ run: gh release edit "$GITHUB_REF_NAME" --draft=false --latest
117
+ - name: Notify deployment result
118
+ if: ${{ always() }}
119
+ uses: jyablonski/actions/deploy-notification@3ff8e3e6dcfb804cc5fc0aed41be72e3ed98a718 # v1
120
+ with:
121
+ slack-webhook: ${{ secrets.SLACK_WEBHOOK_URL }}
122
+ template: ${{ job.status == 'success' && 'deployment-success' || 'pipeline-failure' }}
123
+ deployment-url: https://pypi.org/project/agentslint/
@@ -0,0 +1,13 @@
1
+ # Python-generated files
2
+ __pycache__/
3
+ *.py[oc]
4
+ build/
5
+ dist/
6
+ wheels/
7
+ *.egg-info
8
+ .coverage
9
+ htmlcov/
10
+
11
+ # Virtual environments
12
+ .venv
13
+ docs/plans/**
@@ -0,0 +1,33 @@
1
+ repos:
2
+ - repo: https://github.com/astral-sh/ruff-pre-commit
3
+ rev: v0.16.0
4
+ hooks:
5
+ - id: ruff-check
6
+ args: [--fix]
7
+ - id: ruff-format
8
+
9
+ - repo: https://github.com/astral-sh/ty-pre-commit
10
+ rev: v0.0.63
11
+ hooks:
12
+ - id: ty
13
+ args: [--locked]
14
+
15
+ - repo: https://github.com/lyz-code/yamlfix
16
+ rev: 1.19.1
17
+ hooks:
18
+ - id: yamlfix
19
+
20
+ - repo: https://github.com/adrienverge/yamllint
21
+ rev: v1.38.0
22
+ hooks:
23
+ - id: yamllint
24
+ args: [--strict]
25
+
26
+ - repo: local
27
+ hooks:
28
+ - id: agentslint
29
+ name: agentslint check
30
+ entry: .venv/bin/python -m agentslint check . --strict
31
+ language: system
32
+ always_run: true
33
+ pass_filenames: false
@@ -0,0 +1,10 @@
1
+ extends: default
2
+
3
+ rules:
4
+ comments:
5
+ min-spaces-from-content: 1
6
+ document-start: disable
7
+ line-length: disable
8
+ truthy:
9
+ allowed-values: ["true", "false", "on"]
10
+ check-keys: false
@@ -0,0 +1,58 @@
1
+ # Repository instructions
2
+
3
+ ## Purpose
4
+
5
+ agentslint is a Python CLI that statically validates referential integrity in tracked `AGENTS.md` files. It must remain read-only with respect to the repository being checked and must never execute documented commands, import application code, install target-project dependencies, or access external URLs.
6
+
7
+ ## Setup and validation
8
+
9
+ - Run `make setup` to create or refresh the locked development environment.
10
+ - Run `make test` for the complete pytest suite and coverage gate.
11
+ - Run `make quality` for Ruff, ty, YAML checks, and the strict agentslint self-check.
12
+ - Run `make build` to create the wheel and source distribution.
13
+ - Keep supported Python versions and package metadata in `pyproject.toml`.
14
+
15
+ ## Project layout
16
+
17
+ - CLI argument and exit-code handling lives in `src/agentslint/cli.py`.
18
+ - Repository discovery and the immutable workspace index live in `src/agentslint/discovery.py` and `src/agentslint/workspace.py`.
19
+ - Markdown extraction lives in `src/agentslint/markdown.py`.
20
+ - Validation orchestration and registered rules live in `src/agentslint/engine.py`.
21
+ - Resolver implementations live under `src/agentslint/resolvers/`.
22
+ - Normal tests live under `tests/`; end-to-end repository fixtures live under `tests/fixtures/e2e/`.
23
+ - Resolver contribution guidance lives in `docs/adding-a-resolver.md`.
24
+
25
+ ## Implementation conventions
26
+
27
+ - Use keyword-only parameters for functions where possible.
28
+ - Preserve the existing immutable `Reference` and `Diagnostic` contracts.
29
+ - Return tuples of diagnostics and use `resolvers.base.diagnostic` for consistent source locations.
30
+ - Read repository files through `Workspace` so boundary, size, encoding, parsing, and caching protections remain active.
31
+ - Treat confirmed stale references as errors and genuinely ambiguous or unsupported constructs as warnings.
32
+ - Prefer a narrow resolver extension over a general plugin interface during the `0.x` series.
33
+ - Register new diagnostic rules in the engine and add advisory rules to configuration only when severity overrides are safe.
34
+ - Do not weaken validation globally to accommodate an example; use an exact, reasoned ignore when the example is intentional.
35
+
36
+ ## Tests
37
+
38
+ - Add focused valid, invalid, ambiguous, nested-scope, and hostile-input tests for resolver changes.
39
+ - Extend the end-to-end fixtures when behavior crosses extraction, discovery, configuration, or CLI boundaries.
40
+ - Assert rule, severity, reference, and useful message content rather than only diagnostic counts.
41
+ - Never make a safety test execute repository content.
42
+ - Maintain the coverage floor configured in `pyproject.toml`.
43
+
44
+ ## Documentation
45
+
46
+ - Keep `README.md` accurate for both GitHub and PyPI.
47
+ - Update `docs/adding-a-resolver.md` when resolver wiring or contributor expectations change.
48
+ - Do not claim support for syntax that is only partially or heuristically validated.
49
+ - Keep prose paragraphs and list items on one logical line.
50
+
51
+ ## Releases
52
+
53
+ - Keep repository hooks in `.pre-commit-config.yaml`; this repository does not publish remote hook metadata.
54
+ - Treat `pyproject.toml` as the package-version source of truth and read the installed version through distribution metadata.
55
+ - The package version must be committed to `pyproject.toml` and `uv.lock` on synchronized `main` before release.
56
+ - Run `make release VERSION=v0.1.0` with the matching version to create and push an annotated tag.
57
+ - The tag triggers `.github/workflows/ci_cd.yaml`, which validates, builds, uploads GitHub Release assets, and publishes to PyPI.
58
+ - Never bypass the clean-tree, branch, version, or remote synchronization checks in the release target.
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2026 agentslint contributors
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
@@ -0,0 +1,61 @@
1
+ SHELL := /bin/sh
2
+
3
+ UV ?= uv
4
+
5
+ .PHONY: setup test quality build release
6
+
7
+ setup:
8
+ $(UV) sync --locked --all-groups
9
+
10
+ test:
11
+ $(UV) run --frozen pytest
12
+
13
+ quality:
14
+ $(UV) run --frozen ruff check .
15
+ $(UV) run --frozen ruff format --check src tests
16
+ $(UV) run --frozen ty check
17
+ $(UV) run --frozen agentslint check . --strict
18
+ $(UV) run --frozen pre-commit run --all-files --show-diff-on-failure
19
+
20
+ build:
21
+ $(UV) build
22
+
23
+ release:
24
+ @if [ -z "$(VERSION)" ]; then \
25
+ echo "VERSION is required; use make release VERSION=v0.1.0"; \
26
+ exit 2; \
27
+ fi
28
+ @printf '%s\n' "$(VERSION)" | grep -Eq '^v[0-9]+\.[0-9]+\.[0-9]+([-.][0-9A-Za-z.-]+)?$$' || { \
29
+ echo "VERSION must be a semantic version prefixed with v, such as v0.1.0"; \
30
+ exit 2; \
31
+ }
32
+ @package_version="$$( $(UV) version --short )"; \
33
+ tag_version="$$(printf '%s' "$(VERSION)" | sed 's/^v//')"; \
34
+ if [ "$$package_version" != "$$tag_version" ]; then \
35
+ echo "pyproject.toml version $$package_version does not match $(VERSION)"; \
36
+ echo "Run: uv version $$tag_version"; \
37
+ exit 2; \
38
+ fi; \
39
+ if ! grep -Fq "agentslint==$$tag_version" .github/workflows/check.yml; then \
40
+ echo ".github/workflows/check.yml must pin agentslint==$$tag_version"; \
41
+ exit 2; \
42
+ fi
43
+ @if [ "$$(git branch --show-current)" != "main" ]; then \
44
+ echo "releases must be created from main"; \
45
+ exit 2; \
46
+ fi
47
+ @if [ -n "$$(git status --porcelain)" ]; then \
48
+ echo "the working tree must be clean before creating a release"; \
49
+ exit 2; \
50
+ fi
51
+ @git fetch --quiet origin main --tags
52
+ @if [ "$$(git rev-parse HEAD)" != "$$(git rev-parse origin/main)" ]; then \
53
+ echo "local main must match origin/main before creating a release"; \
54
+ exit 2; \
55
+ fi
56
+ @if git rev-parse --quiet --verify "refs/tags/$(VERSION)" >/dev/null; then \
57
+ echo "tag $(VERSION) already exists"; \
58
+ exit 2; \
59
+ fi
60
+ git tag --annotate "$(VERSION)" --message "Release $(VERSION)"
61
+ git push origin "$(VERSION)"