Skip to content

Commit e54bd43

Browse files
committed
Update: add 4 file(s), modify 5 file(s)
1 parent 75c31c7 commit e54bd43

9 files changed

Lines changed: 202 additions & 2 deletions

File tree

.editorconfig

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
# This file is for EditorConfig and helps maintain consistent coding styles.
2+
3+
root = true
4+
5+
[*]
6+
indent_style = space
7+
indent_size = 4
8+
charset = utf-8
9+
end_of_line = lf
10+
insert_final_newline = true
11+
trim_trailing_whitespace = true
12+
13+
[*.md]
14+
trim_trailing_whitespace = false
15+
16+
[Makefile]
17+
indent_style = tab
18+
indent_size = 4
19+
end_of_line = lf
20+
trim_trailing_whitespace = true
21+
insert_final_newline = true

.gitignore

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,10 @@
44
**/*.egg-info/
55
.coverage
66
.ash/
7+
.venv/
78

89
.kiro/*
910
.kiro/**/*
11+
12+
uv.lock
13+

.vscode/settings.json.example

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
{
2+
"python.defaultInterpreterPath": "${workspaceFolder}/.venv/bin/python",
3+
"git.openRepositoryInParentFolders": "always",
4+
"python.analysis.extraPaths": [],
5+
"notebook.formatOnSave.enabled": true,
6+
"notebook.codeActionsOnSave": {
7+
"notebook.source.fixAll": "explicit",
8+
"notebook.source.organizeImports": "explicit"
9+
},
10+
"[python]": {
11+
"editor.formatOnSave": true,
12+
"editor.defaultFormatter": "charliermarsh.ruff",
13+
"editor.codeActionsOnSave": {
14+
"source.fixAll": "explicit",
15+
"source.organizeImports": "explicit"
16+
},
17+
},
18+
"makefile.configureOnOpen": false
19+
}

AGENTS.md

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
# General Guidance for Agentic Coding Assistants
2+
3+
## Documentation
4+
- When writing documentation, always try to say more with less.
5+
- Documentation should be minimal, and only say what needs to be said to communicate how to work with and extend the system.
6+
7+
## MKDocs Documentation Project
8+
- An MKDocs documentation project exists at [docs/](./docs/). More information can be found in the [docs/README.md](./docs/README.md) and [docs/AGENTS.md](./docs/AGENTS.md) files.
9+
10+
## Testing
11+
- Test documentation and guidelines can be found in [tests/README.md](./tests/README.md).
12+
13+
## README.md
14+
- In addition to MKDocs, The project strives to maintain developer documentation distributed in README.md files throughout the codebase. This documentation exists to help human and AI coding assistants when working with the codebase.
15+
- When creating directories or working in a directory that does not have a README.md create a README.md file and document the final state of the code and logic that's in the directory. Do this in language that an AI coding assistant trying to understand the implementation and codebas would understand.
16+
- When working in a directory, always look for a README.md and/or AGENTS.md file for important context about the directory/code contained within.

Makefile

Lines changed: 27 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,13 @@
11
# Simple Makefile for stickler
22

3+
# Define color codes for terminal output
4+
RED := \033[0;31m
5+
GREEN := \033[0;32m
6+
YELLOW := \033[1;33m
7+
NC := \033[0m # No Color
8+
39
install:
4-
pip install -e .
10+
pip install -e ".[all]"
511

612
install-dev:
713
pip install -e ".[dev]"
@@ -12,3 +18,23 @@ test:
1218
clean:
1319
find . -type d -name "__pycache__" -exec rm -rf {} + 2>/dev/null || true
1420
find . -type f -name "*.pyc" -delete
21+
22+
# Run linting checks and automatically fix issues
23+
lint:
24+
ruff check --fix
25+
26+
# CI/CD version of lint that only checks but doesn't modify files
27+
# Strict lint check for CI/CD (currently disabled, see lint-cicd_x for reference)
28+
lint-cicd_x:
29+
@echo "Running code quality checks..."
30+
@if ! ruff check; then \
31+
echo -e "$(RED)ERROR: Ruff linting failed!$(NC)"; \
32+
echo -e "$(YELLOW)Please run 'make ruff-lint' locally to fix these issues.$(NC)"; \
33+
exit 1; \
34+
fi
35+
@if ! ruff format --check; then \
36+
echo -e "$(RED)ERROR: Code formatting check failed!$(NC)"; \
37+
echo -e "$(YELLOW)Please run 'make format' locally to fix these issues.$(NC)"; \
38+
exit 1; \
39+
fi
40+
@echo -e "$(GREEN)All code quality checks passed!$(NC)"

README.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -654,3 +654,8 @@ print(f"Line Items: {result['field_scores']['line_items']:.3f}") # ~1.0 - match
654654
## Examples
655655

656656
Check out the `examples/` directory for more detailed usage examples and notebooks.
657+
658+
# A note for AI assisted coding agents
659+
- The project uses coding assistant agnostic context files, like README.md and AGENTS.md
660+
- When working in a directory, always look for a README.md and/or AGENTS.md file for important context about the directory/code contained within.
661+
- Read this [AGENTS.md](./AGENTS.md) file for more information

docs/docs/Contributing/code-style.md

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,23 @@ ruff check --fix .
2626
ruff check src/stickler/comparators/
2727
```
2828

29+
### Automatic Formatting in VS Code
30+
31+
To enable automatic code formatting and linting in VS Code:
32+
33+
1. Copy the example settings file:
34+
```bash
35+
cp .vscode/settings.json.example .vscode/settings.json
36+
```
37+
38+
2. Install the Ruff extension for VS Code (if not already installed):
39+
- Open VS Code
40+
- Go to Extensions (Cmd+Shift+X on macOS, Ctrl+Shift+X on Windows/Linux)
41+
- Search for "Ruff" by Charlie Marsh
42+
- Click Install
43+
44+
The settings file configures VS Code to automatically format Python files on save and organize imports using Ruff.
45+
2946
### CI Integration
3047

3148
Linting runs automatically on every push and pull request via GitHub Actions. While currently non-blocking, you should address linting issues before submitting PRs.

pyproject.toml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,8 @@ dev = [
2727
"pytest>=7.0.0",
2828
"pytest-xdist>=3.0.0",
2929
"coverage>=7.0.0",
30-
"beautifulsoup4>=4.14.2"
30+
"beautifulsoup4>=4.14.2",
31+
"ruff>=0.14.10",
3132
]
3233

3334
llm = [

ruff.toml

Lines changed: 91 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,91 @@
1+
# Let's exclude some whole directories until we are ready to format them individually
2+
extend-exclude = []
3+
4+
5+
6+
# Exclude a variety of commonly ignored directories.
7+
exclude = [
8+
".bzr",
9+
".direnv",
10+
".eggs",
11+
".git",
12+
".git-rewrite",
13+
".hg",
14+
".ipynb_checkpoints",
15+
".mypy_cache",
16+
".nox",
17+
".pants.d",
18+
".pyenv",
19+
".pytest_cache",
20+
".pytype",
21+
".ruff_cache",
22+
".svn",
23+
".tox",
24+
".venv",
25+
".vscode",
26+
"__pypackages__",
27+
"_build",
28+
"buck-out",
29+
"build",
30+
"dist",
31+
"node_modules",
32+
"site-packages",
33+
"venv",
34+
]
35+
36+
# Same as Black.
37+
line-length = 88
38+
indent-width = 4
39+
40+
# Assume Python 3.9
41+
target-version = "py39"
42+
43+
[lint]
44+
# Enable Pyflakes (`F`) and a subset of the pycodestyle (`E`) codes by default.
45+
# Unlike Flake8, Ruff doesn't enable pycodestyle warnings (`W`) or
46+
# McCabe complexity (`C901`) by default.
47+
select = ["E4", "E7", "E9", "F"]
48+
ignore = []
49+
# Note: if you're using Ruff to organize imports in VS Code and also expect to run Ruff from the command line, you'll want to enable Ruff's isort rules by adding "I" to your extend-select.
50+
extend-select = ["I"]
51+
52+
# Allow fix for all enabled rules (when `--fix`) is provided.
53+
fixable = ["ALL"]
54+
unfixable = []
55+
56+
# Allow unused variables when underscore-prefixed.
57+
dummy-variable-rgx = "^(_+|(_+[a-zA-Z0-9_]*[a-zA-Z0-9]+?))$"
58+
59+
[lint.per-file-ignores]
60+
# Let's ignore some annoying rules in notebooks
61+
"notebooks/*" = ["F401"]
62+
# Disable module level import not at top of file for src (needed for path manipulation)
63+
"src/**/*.py" = ["E402"]
64+
65+
66+
[format]
67+
# Like Black, use double quotes for strings.
68+
quote-style = "double"
69+
70+
# Like Black, indent with spaces, rather than tabs.
71+
indent-style = "space"
72+
73+
# Like Black, respect magic trailing commas.
74+
skip-magic-trailing-comma = false
75+
76+
# Like Black, automatically detect the appropriate line ending.
77+
line-ending = "auto"
78+
79+
# Enable auto-formatting of code examples in docstrings. Markdown,
80+
# reStructuredText code/literal blocks and doctests are all supported.
81+
#
82+
# This is currently disabled by default, but it is planned for this
83+
# to be opt-out in the future.
84+
docstring-code-format = false
85+
86+
# Set the line length limit used when formatting code snippets in
87+
# docstrings.
88+
#
89+
# This only has an effect when the `docstring-code-format` setting is
90+
# enabled.
91+
docstring-code-line-length = "dynamic"

0 commit comments

Comments
 (0)