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
8 changes: 8 additions & 0 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,14 @@ pytest
ruff check .
```

Auto-format and auto-fix what ruff can fix on its own:

```bash
scripts/format.sh
```

Use `scripts/format.sh --check` to verify formatting without writing changes.

## Documentation

User-facing documentation lives in [docs/](docs/) and is built with MkDocs. If you change or add public behaviour, update the relevant page there.
Expand Down
16 changes: 16 additions & 0 deletions scripts/format.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
#!/usr/bin/env bash
# Auto-format the codebase and fix auto-fixable lint issues with ruff.
#
# Usage:
# scripts/format.sh # format in place
# scripts/format.sh --check # fail if anything would change, don't write (for CI)
set -euo pipefail
cd "$(dirname "${BASH_SOURCE[0]}")/.."

if [[ "${1:-}" == "--check" ]]; then
ruff format --check .
ruff check .
else
ruff format .
ruff check --fix .
fi
2 changes: 1 addition & 1 deletion src/earthrs/processing/atmospheric.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,4 +18,4 @@ def atmospheric_correction(scene: Scene, *, method: str = "default", **kwargs: A
_ = kwargs
raise NotImplementedError(
"Atmospheric correction is not yet implemented. Check for a new version of earthrs."
)
)
Loading