Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 0 additions & 2 deletions .flake8

This file was deleted.

4 changes: 2 additions & 2 deletions .github/maintainers_guide.md
Original file line number Diff line number Diff line change
Expand Up @@ -47,10 +47,10 @@ This project contains an [`.editorconfig`](../.editorconfig) file. It is used by
### Linting & Formatting

```zsh
# Run flake8 & prettier from root directory for linting
# Run ruff & prettier from root directory for linting
./scripts/lint.sh

# Run black & prettier from root directory for code formatting
# Run ruff & prettier from root directory for code formatting
./scripts/format.sh
```

Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/ci-build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ jobs:
- name: Install dependencies
run: |
pip install -U .
- name: Lint with flake8 & Prettier
- name: Lint with ruff & Prettier
run: |
bash scripts/lint.sh

Expand Down
6 changes: 3 additions & 3 deletions AGENTS.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,10 +20,10 @@ pip install -U -e .
# Run a single test file
./scripts/test.sh tests/test_manifest_v2_schema.py

# Lint (flake8 for Python, Prettier for JSON)
# Lint (ruff for Python, Prettier for JSON)
./scripts/lint.sh

# Format (black for Python, Prettier for JSON)
# Format (ruff for Python, Prettier for JSON)
./scripts/format.sh
```

Expand All @@ -37,7 +37,7 @@ Tests validate manifests against the schema using `jsonschema.validate()`. Each

## Style

- Python: black, line length 100, flake8
- Python: ruff (lint + format), line length 100, config in `pyproject.toml`
- JSON: Prettier, 2-space indent, LF line endings (see `.editorconfig`)
- Tests use pytest with `GIVEN/WHEN/THEN` comment structure

Expand Down
25 changes: 22 additions & 3 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -6,18 +6,37 @@ license = "MIT"
license-files = ["LICENSE"]
authors = [{ name = "Slack Technologies, LLC", email = "opensource@slack.com" }]
dependencies = [
"flake8==7.4.1",
"black==26.5.1",
"ruff==0.16.4",
"pytest==9.1.1",
"jsonschema==4.26.0",
]

[tool.setuptools]
packages = ["tests"]

[tool.black]
[tool.ruff]
line-length = 100

[tool.ruff.lint]
select = ["E", "W", "F", "D"]
ignore = [
# missing-docstring: do not add docstrings where none exist
"D100",
"D101",
"D102",
"D103",
"D104",
"D105",
"D106",
"D107",
]

[tool.ruff.lint.pydocstyle]
convention = "google"

[tool.ruff.format]
docstring-code-format = true

[tool.pytest.ini_options]
testpaths = ["tests"]
log_file = "logs/pytest.log"
Expand Down
5 changes: 3 additions & 2 deletions scripts/format.sh
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
#!/bin/bash
# ./scripts/run_flake8.sh
# ./scripts/format.sh

script_dir=$(dirname $0)
cd ${script_dir}/.. && \
black tests/ && \
ruff check --fix tests/ && \
ruff format tests/ && \
npx prettier --write schemas/**/*.json *.json tests/**/*.json
6 changes: 2 additions & 4 deletions scripts/install_all_and_run_tests.sh
Original file line number Diff line number Diff line change
Expand Up @@ -12,11 +12,9 @@ pip install -U -e .

if [[ $test_target != "" ]]
then
black tests/ && \
npx prettier --write schemas/**/*.json *.json tests/**/*.json && \
./scripts/format.sh && \
pytest $1
else
black tests/ && \
npx prettier --write schemas/**/*.json *.json tests/**/*.json && \
./scripts/format.sh && \
pytest
fi
5 changes: 3 additions & 2 deletions scripts/lint.sh
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
#!/bin/bash
# ./scripts/run_flake8.sh
# ./scripts/lint.sh

script_dir=$(dirname $0)
cd ${script_dir}/.. && \
flake8 tests/ && \
ruff check tests/ && \
ruff format --check tests/ && \
npx prettier --check schemas/**/*.json *.json tests/**/*.json
4 changes: 2 additions & 2 deletions scripts/test.sh
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,8 @@ test_target="$1"

if [[ $test_target != "" ]]
then
black tests/ && \
./scripts/format.sh && \
pytest -vv $1
else
black tests/ && pytest -vv
./scripts/format.sh && pytest -vv
fi
Loading