Skip to content

Commit

Permalink
Merge pull request #1271 from gboeing/yaml
Browse files Browse the repository at this point in the history
Add yamllint config file and pretty format json
  • Loading branch information
gboeing authored Jan 13, 2025
2 parents c0f1db3 + e96d508 commit 01b2384
Show file tree
Hide file tree
Showing 6 changed files with 39 additions and 28 deletions.
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

0 comments on commit 01b2384

Please sign in to comment.