Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add yamllint config file and pretty format json #1271

Merged
merged 4 commits into from
Jan 13, 2025
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: 7 additions & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,13 @@ jobs:
run: python -m sphinx -E -W --keep-going -b html ./docs/source ./docs/build/html

- name: Test code and coverage
run: python -m pytest --verbose --maxfail=1 --typeguard-packages=osmnx --cov=osmnx --cov-report=xml
run: >
python -m pytest
--verbose
--maxfail=1
--typeguard-packages=osmnx
--cov=osmnx
--cov-report=xml

- name: Upload coverage report
uses: codecov/codecov-action@v5
Expand Down
14 changes: 4 additions & 10 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -19,24 +19,18 @@ repos:
- id: fix-byte-order-marker
- id: mixed-line-ending
- id: no-commit-to-branch
args: [--branch, main]
- id: pretty-format-json
args: [--autofix]
- id: trailing-whitespace

- repo: https://github.com/adrienverge/yamllint
rev: v1.35.1
hooks:
- id: yamllint
args:
- --strict
- >
-d={extends: default, rules: {
document-start: disable,
line-length: {max: 110},
quoted-strings: {quote-type: single, required: only-when-needed},
truthy: {check-keys: false}}}
args: [--strict, --config-file=./tests/.yamllint.yml]

- repo: https://github.com/astral-sh/ruff-pre-commit
rev: v0.8.6
rev: v0.9.1
hooks:
- id: ruff
args: [--fix]
Expand Down
32 changes: 16 additions & 16 deletions environments/requirements/environments.json
Original file line number Diff line number Diff line change
@@ -1,39 +1,39 @@
[
{
"output_path": "./environments/tests/env-ci.yml",
"needs_dependencies": true,
"pin_exact": false,
"extras": [
"./environments/requirements/requirements-docs.txt",
"./environments/requirements/requirements-packaging.txt",
"./environments/requirements/requirements-tests.txt"
]
],
"needs_dependencies": true,
"output_path": "./environments/tests/env-ci.yml",
"pin_exact": false
},
{
"output_path": "./environments/tests/env-test-minimum-deps.yml",
"needs_dependencies": true,
"pin_exact": true,
"extras": [
"./environments/requirements/requirements-tests.txt"
]
],
"needs_dependencies": true,
"output_path": "./environments/tests/env-test-minimum-deps.yml",
"pin_exact": true
},
{
"output_path": "./environments/tests/requirements-test-latest-deps.txt",
"needs_dependencies": true,
"pin_exact": false,
"extras": [
"./environments/requirements/requirements-tests.txt"
]
],
"needs_dependencies": true,
"output_path": "./environments/tests/requirements-test-latest-deps.txt",
"pin_exact": false
},
{
"output_path": "./environments/requirements/requirements-all.txt",
"needs_dependencies": true,
"pin_exact": false,
"extras": [
"./environments/requirements/requirements-docs.txt",
"./environments/requirements/requirements-extras.txt",
"./environments/requirements/requirements-packaging.txt",
"./environments/requirements/requirements-tests.txt"
]
],
"needs_dependencies": true,
"output_path": "./environments/requirements/requirements-all.txt",
"pin_exact": false
}
]
1 change: 1 addition & 0 deletions osmnx/io.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
# ruff: noqa: A005
"""File I/O functions to save/load graphs to/from files on disk."""

from __future__ import annotations
Expand Down
10 changes: 10 additions & 0 deletions tests/.yamllint.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
extends: default
rules:
document-start: disable
line-length:
max: 100
quoted-strings:
quote-type: single
required: only-when-needed
truthy:
check-keys: false
2 changes: 1 addition & 1 deletion tests/test_osmnx.py
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@
address = "600 Montgomery St, San Francisco, California, USA"
place1 = {"city": "Piedmont", "state": "California", "country": "USA"}
polygon_wkt = (
"POLYGON ((-122.262 37.869, -122.255 37.869, -122.255 37.874,"
"POLYGON ((-122.262 37.869, -122.255 37.869, -122.255 37.874, "
"-122.262 37.874, -122.262 37.869))"
)
polygon = ox.utils_geo.buffer_geometry(geom=wkt.loads(polygon_wkt), dist=1)
Expand Down
Loading