Skip to content

Commit

Permalink
Chore: update and freeze ruff version
Browse files Browse the repository at this point in the history
  • Loading branch information
xsedla1o committed Feb 5, 2025
1 parent 3209697 commit d8ae2b4
Show file tree
Hide file tree
Showing 7 changed files with 14 additions and 17 deletions.
4 changes: 3 additions & 1 deletion .github/workflows/lint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,4 +18,6 @@ jobs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: jpetrucciani/ruff-check@main
- uses: astral-sh/ruff-action@v3
with:
version: "0.9.4"
4 changes: 3 additions & 1 deletion .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,9 @@ jobs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: jpetrucciani/ruff-check@main
- uses: astral-sh/ruff-action@v3
with:
version: "0.9.4"

# Tests
api-tests:
Expand Down
3 changes: 1 addition & 2 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@ repos:
- id: check-case-conflict
- id: check-merge-conflict
- id: check-symlinks
- id: check-yaml
- id: debug-statements
- id: mixed-line-ending
- id: requirements-txt-fixer
Expand All @@ -18,7 +17,7 @@ repos:
- id: black

- repo: https://github.com/charliermarsh/ruff-pre-commit
rev: 'v0.7.4'
rev: 'v0.9.4'
hooks:
- id: ruff
args: [ "--fix", "." ]
4 changes: 2 additions & 2 deletions dp3/database/snapshots.py
Original file line number Diff line number Diff line change
Expand Up @@ -246,8 +246,8 @@ def _prepare_latest_query(
query["latest"] = True

# Process fulltext filters
for attr in fulltext_filters:
fulltext_filter = {"$regex": fulltext_filters[attr], "$options": "i"}
for attr, attr_filter in fulltext_filters:
fulltext_filter = {"$regex": attr_filter, "$options": "i"}

# EID filter
if attr == "eid":
Expand Down
4 changes: 2 additions & 2 deletions tests/test_api/test_get_distinct_attr_values.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,14 +22,14 @@ def setUpClass(cls) -> None:
}

# Push datapoints
for attr in dps_attr_value:
for attr, attr_val in dps_attr_value.items():
res = cls.push_datapoints(
[
{
"type": "test_entity_type",
"id": "test_entity_id",
"attr": attr,
"v": dps_attr_value[attr],
"v": attr_val,
}
]
)
Expand Down
4 changes: 1 addition & 3 deletions tests/test_example/dps_gen.py
Original file line number Diff line number Diff line change
Expand Up @@ -58,9 +58,7 @@ def random_passenger_counts_3():
"S20": {"label": "School bus 20", "location": random_initial_location()},
}

for n in bus_lines:
bus_line = bus_lines[n]

for n, bus_line in bus_lines.items():
dps.append(
{
"type": "bus",
Expand Down
8 changes: 2 additions & 6 deletions tests/test_example/dps_gen_realtime.py
Original file line number Diff line number Diff line change
Expand Up @@ -70,9 +70,7 @@ def random_passenger_counts_3():
dps = []

# One-time datapoints
for n in bus_lines:
bus_line = bus_lines[n]

for n, bus_line in bus_lines.items():
dps.append(
{
"type": "bus",
Expand All @@ -87,9 +85,7 @@ def random_passenger_counts_3():

# Realtime datapoints
while True:
for n in bus_lines:
bus_line = bus_lines[n]

for n, bus_line in bus_lines.items():
dps.append(
{
"type": "bus",
Expand Down

0 comments on commit d8ae2b4

Please sign in to comment.