Skip to content

Commit 50531d3

Browse files
committed
Merge remote-tracking branch 'origin/master' into favyen/issue14
2 parents 51e0e52 + 0bb6b73 commit 50531d3

File tree

68 files changed

+12944
-3333
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

68 files changed

+12944
-3333
lines changed

.github/workflows/lint.yaml

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
name: Lint (type checking, security, code quality, ruff)
2+
3+
on:
4+
push:
5+
branches:
6+
- "henryh/add-linting-workflow"
7+
pull_request:
8+
branches:
9+
- "master"
10+
11+
concurrency:
12+
group: ${{ github.workflow }}-${{ github.ref }}
13+
cancel-in-progress: true
14+
15+
jobs:
16+
linting:
17+
runs-on: ubuntu-latest
18+
19+
steps:
20+
- uses: actions/checkout@v4
21+
with:
22+
lfs: false
23+
24+
- name: Set up Python 3.10
25+
uses: actions/setup-python@v4
26+
with:
27+
python-version: 3.10.10
28+
pip-version: 24
29+
30+
- name: Linting
31+
run: |
32+
pip install pre-commit interrogate
33+
pre-commit run --all-files

.gitignore

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
.env
22
wandb/
3-
rslp/__pycache__/
3+
rslp/__pycache__/

.pre-commit-config.yaml

Lines changed: 92 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,99 @@
1+
exclude_types: ["*.geojson"]
2+
exclude: ^(one_off_projects|landsat|platforms|sentinel2_postprocess_revamp|amazon_conservation|convert_satlas_webmercator_to_rslearn)/ # Exlcluding projects that have not been migrated to rslp
3+
ci:
4+
autofix_prs: false
5+
autoupdate_branch: ""
6+
autoupdate_commit_msg: "[pre-commit.ci] pre-commit autoupdate"
7+
autoupdate_schedule: weekly
8+
skip: [end-of-file-fixer, equirements-txt-fixer]
19
repos:
10+
- repo: https://github.com/pre-commit/pre-commit-hooks
11+
rev: v4.4.0
12+
hooks:
13+
- id: check-yaml
14+
- id: end-of-file-fixer
15+
- id: trailing-whitespace
16+
- id: check-json
17+
- id: mixed-line-ending
18+
- id: requirements-txt-fixer
19+
- id: pretty-format-json
20+
args: ["--autofix"]
21+
- id: check-case-conflict
22+
- id: check-docstring-first
23+
- id: check-added-large-files
24+
exclude: wheels/*
25+
- id: check-ast
26+
- id: check-byte-order-marker
27+
- id: check-executables-have-shebangs
28+
- id: check-merge-conflict
29+
- id: check-toml
30+
- id: debug-statements
31+
- id: detect-aws-credentials
32+
args: [--allow-missing-credentials]
33+
- id: detect-private-key
34+
35+
- repo: https://github.com/pre-commit/mirrors-mypy
36+
rev: v1.1.1
37+
hooks:
38+
- id: mypy
39+
args: [
40+
--install-types,
41+
--ignore-missing-imports,
42+
--disallow-untyped-defs,
43+
--ignore-missing-imports,
44+
--non-interactive,
45+
# --no-namespace-packages,
46+
--namespace-packages,
47+
]
48+
additional_dependencies:
49+
- "pydantic>=2.7.1,<3"
50+
- "types-protobuf"
51+
exclude: ./.*_pb2_.*.py
52+
- repo: https://github.com/PyCQA/bandit
53+
rev: "1.7.5"
54+
hooks:
55+
- id: bandit
56+
exclude: ^tests/
57+
args:
58+
- -s
59+
- B101,B311,B324,B108,B104
60+
- repo: local
61+
hooks:
62+
- id: interrogate
63+
name: interrogate
64+
language: system
65+
entry: interrogate
66+
types: [python]
67+
args:
68+
[
69+
--ignore-init-method,
70+
--ignore-init-module,
71+
-p,
72+
-vv,
73+
rslp,
74+
--fail-under=80,
75+
]
276
- repo: https://github.com/astral-sh/ruff-pre-commit
3-
# Ruff version.
477
rev: v0.4.4
578
hooks:
6-
# Run the linter.
779
- id: ruff
880
args: [ --fix ]
9-
# Run the formatter.
1081
- id: ruff-format
82+
# - repo: https://github.com/hadolint/hadolint
83+
# rev: v2.7.0
84+
# hooks:
85+
# - id: hadolint-docker
86+
# name: Lint Dockerfiles
87+
# description: Runs hadolint Docker image to lint Dockerfiles
88+
# language: docker_image
89+
# types: ["dockerfile"]
90+
# entry: ghcr.io/hadolint/hadolint hadolint
91+
# args: ["--ignore", "DL3008"]
92+
# - repo: local
93+
# hooks:
94+
# - id: convert-list
95+
# name: Convert List to list (note case)
96+
# entry: python3 convert_List_to_list.py
97+
# language: system
98+
# types: [python] # Ensures it only runs on Python files
99+
# files: \.py$ # Ensures it only runs on files with a .py extension

0 commit comments

Comments
 (0)