Skip to content

Commit

Permalink
Merge pull request #1260 from gboeing/yaml
Browse files Browse the repository at this point in the history
Add yamllint to pre-commit
  • Loading branch information
gboeing authored Dec 24, 2024
2 parents 977aa0f + cd3e22a commit f79a817
Show file tree
Hide file tree
Showing 12 changed files with 108 additions and 64 deletions.
36 changes: 29 additions & 7 deletions .github/ISSUE_TEMPLATE/bug_report.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,10 @@ body:
id: contributing
attributes:
label: Contributing guidelines
description: Before you proceed, read the [contributing guidelines](../blob/main/CONTRIBUTING.md) regarding where to ask usage questions and how to file a bug report.
description: |
Before you proceed, read the
[contributing guidelines](../blob/main/CONTRIBUTING.md)
regarding where to ask usage questions and how to file a bug report.
options:
- label: I understand the contributing guidelines
required: true
Expand All @@ -19,7 +22,10 @@ body:
id: documentation_examples
attributes:
label: Documentation
description: Before you proceed, review the [documentation](https://osmnx.readthedocs.io/) and [examples gallery](https://github.com/gboeing/osmnx-examples), which cover key concepts, installation, and package usage.
description: |
Before you proceed, review the [documentation](https://osmnx.readthedocs.io/)
and [examples gallery](https://github.com/gboeing/osmnx-examples), which
cover key concepts, installation, and package usage.
options:
- label: My problem is not addressed by the documentation or examples
required: true
Expand All @@ -28,7 +34,9 @@ body:
id: existing_issue
attributes:
label: Existing issues
description: Before you proceed, search the open and closed issues to see if the problem has already been reported.
description: |
Before you proceed, search the open and closed issues to see if the
problem has already been reported.
options:
- label: My problem does not appear in an existing issue
required: true
Expand All @@ -54,7 +62,9 @@ body:
id: environment
attributes:
label: Environment packages and versions
description: Paste the complete output of `conda list` here. Auto-rendered as code, no need for backticks.
description: |
Paste the complete output of `conda list` here. Auto-rendered as code,
no need for backticks.
render: shell
validations:
required: true
Expand All @@ -63,7 +73,10 @@ body:
id: installation
attributes:
label: How did you install OSMnx?
description: Ensure you followed the [installation](https://osmnx.readthedocs.io/en/stable/installation.html) instructions.
description: |
Ensure you followed the
[installation](https://osmnx.readthedocs.io/en/stable/installation.html)
instructions.
multiple: false
options:
- Other (describe below)
Expand All @@ -77,7 +90,9 @@ body:
id: description
attributes:
label: Problem description
description: What did you do? What did you expect to happen? What actually happened instead?
description: |
What did you do? What did you expect to happen? What actually happened
instead?
validations:
required: true

Expand All @@ -86,7 +101,14 @@ body:
attributes:
label: Complete minimal reproducible example
description: |
This example code snippet must be *minimal* so it doesn't contain extraneous code or data unrelated to your specific problem and it must be *complete* so we can independently run it from top to bottom by copying/pasting it into a Python interpreter. That means all imports and all variables must be defined. If you're unsure how to create a good reproducible example, read [this guide](https://matthewrocklin.com/blog/work/2018/02/28/minimal-bug-reports). Do not post a screenshot of your code or error message: provide it as text. Auto-rendered as code, no need for backticks.
This example code snippet must be *minimal* so it doesn't contain extraneous
code or data unrelated to your specific problem and it must be *complete*
so we can independently run it from top to bottom by copying/pasting it
into a Python interpreter. That means all imports and all variables must
be defined. If you're unsure how to create a good reproducible example, read
[this guide](https://matthewrocklin.com/blog/work/2018/02/28/minimal-bug-reports).
Do not post a screenshot of your code or error message: provide it as text.
Auto-rendered as code, no need for backticks.
render: python
validations:
required: true
30 changes: 23 additions & 7 deletions .github/ISSUE_TEMPLATE/feature_proposal.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,9 @@ body:
id: contributing
attributes:
label: Contributing guidelines
description: Before you proceed, read the [contributing guidelines](../blob/main/CONTRIBUTING.md) regarding where to ask usage questions and how to propose a feature.
description: |
Before you proceed, read the [contributing guidelines](../blob/main/CONTRIBUTING.md)
regarding where to ask usage questions and how to propose a feature.
options:
- label: I understand the contributing guidelines
required: true
Expand All @@ -19,7 +21,10 @@ body:
id: documentation_examples
attributes:
label: Documentation
description: Before you proceed, review the [documentation](https://osmnx.readthedocs.io/) and [examples gallery](https://github.com/gboeing/osmnx-examples), which cover key concepts, installation, and package usage.
description: |
Before you proceed, review the [documentation](https://osmnx.readthedocs.io/)
and [examples gallery](https://github.com/gboeing/osmnx-examples), which cover
key concepts, installation, and package usage.
options:
- label: My proposal is not addressed by the documentation or examples
required: true
Expand All @@ -28,7 +33,9 @@ body:
id: existing_issue
attributes:
label: Existing issues
description: Before you proceed, search the open/closed issues and pull requests to see if anything similar has been proposed.
description: |
Before you proceed, search the open/closed issues and pull requests to see if
anything similar has been proposed.
options:
- label: Nothing similar appears in an existing issue
required: true
Expand All @@ -37,30 +44,39 @@ body:
id: problem
attributes:
label: What problem does your feature proposal solve?
description: Provide a clear and concise description of your use case and the current problem, challenge, or limitation.
description: |
Provide a clear and concise description of your use case and the current problem,
challenge, or limitation.
validations:
required: true

- type: textarea
id: solution
attributes:
label: What is your proposed solution?
description: Provide a clear and concise description of what you want to change in OSMnx and how you plan to implement it.
description: |
Provide a clear and concise description of what you want to change in OSMnx and
how you plan to implement it.
validations:
required: true

- type: textarea
id: alternatives
attributes:
label: What alternatives have you considered?
description: Provide a clear and concise description of any alternative solutions, features, or workarounds you have considered.
description: |
Provide a clear and concise description of any alternative solutions, features,
or workarounds you have considered.
validations:
required: true

- type: textarea
id: mwe
attributes:
label: Additional context
description: Provide a complete minimal working example of code to demonstrate your use case. Add any additional code snippets, context, or screenshots about the feature proposal to demonstrate its importance and feasibility.
description: |
Provide a complete minimal working example of code to demonstrate your use case.
Add any additional code snippets, context, or screenshots about the feature
proposal to demonstrate its importance and feasibility.
validations:
required: true
2 changes: 1 addition & 1 deletion .github/workflows/build-publish-docker.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ on:
tags:
- 'v*'
schedule:
- cron: "50 4 * * 1" # every monday at 04:50 UTC
- cron: "50 4 * * 1" # every monday at 04:50 UTC

jobs:
build_publish_docker:
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/build-publish-pypi.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ on:
tags:
- 'v*'
schedule:
- cron: "40 4 * * 1" # every monday at 04:40 UTC
- cron: "40 4 * * 1" # every monday at 04:40 UTC

jobs:
build_publish_pypi:
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ on:
pull_request:
branches: [main, v1]
schedule:
- cron: "0 4 * * 1" # every monday at 04:00 UTC
- cron: "0 4 * * 1" # every monday at 04:00 UTC
workflow_dispatch:

jobs:
Expand Down Expand Up @@ -48,7 +48,7 @@ jobs:
uses: actions/cache@v4
with:
path: ~/.cache/pre-commit/
key: pre-commit-${{ matrix.os }}-${{ matrix.python-version }}-${{ hashFiles('.pre-commit-config.yaml') }}
key: pre-commit-${{ matrix.python-version }}-${{ hashFiles('.pre-commit-config.yaml') }}

- name: Run pre-commit checks
run: pre-commit run --all-files
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/test-docs-linkcheck.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ name: Build docs and check links

on:
schedule:
- cron: "10 4 * * 1" # every monday at 04:10 UTC
- cron: "10 4 * * 1" # every monday at 04:10 UTC
workflow_dispatch:

jobs:
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/test-latest-deps.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ name: Test latest/pre-release dependencies

on:
schedule:
- cron: "30 4 * * 1" # every monday at 04:30 UTC
- cron: "30 4 * * 1" # every monday at 04:30 UTC
workflow_dispatch:

jobs:
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/test-minimum-deps.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ name: Test minimum dependencies

on:
schedule:
- cron: "20 4 * * 1" # every monday at 04:20 UTC
- cron: "20 4 * * 1" # every monday at 04:20 UTC
workflow_dispatch:

jobs:
Expand Down
12 changes: 9 additions & 3 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
repos:
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: "v5.0.0"
rev: v5.0.0
hooks:
- id: check-added-large-files
args: [--maxkb=50]
Expand All @@ -22,15 +22,21 @@ repos:
args: [--branch, main]
- id: trailing-whitespace

- repo: https://github.com/adrienverge/yamllint
rev: v1.35.1
hooks:
- id: yamllint
args: [--strict, -d, "{extends: relaxed, rules: {line-length: {max: 110}}}"]

- repo: https://github.com/astral-sh/ruff-pre-commit
rev: "v0.8.2"
rev: v0.8.4
hooks:
- id: ruff
args: [--fix]
- id: ruff-format

- repo: https://github.com/pre-commit/mirrors-mypy
rev: "v1.13.0"
rev: v1.14.0
hooks:
- id: mypy
additional_dependencies:
Expand Down
2 changes: 1 addition & 1 deletion environments/make-env-files.py
Original file line number Diff line number Diff line change
Expand Up @@ -124,7 +124,7 @@ def make_file(env_name: str) -> None:
text = ""
for k, v in data.items():
if isinstance(v, list):
text += k + ":\n- " + "\n- ".join(v) + "\n"
text += k + ":\n - " + "\n - ".join(v) + "\n"
elif isinstance(v, str):
text += k + ": " + v + "\n"
f.writelines(HEADER + text)
Expand Down
42 changes: 21 additions & 21 deletions environments/tests/env-ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,25 +3,25 @@
# environments/environments.json and the requirements in pyproject.toml.
name: env-ci
channels:
- conda-forge
- conda-forge
dependencies:
- furo
- geopandas>=1.0
- lxml
- matplotlib>=3.5
- networkx>=2.5
- numpy>=1.22
- pandas>=1.4
- pre-commit
- pytest
- pytest-cov
- python>=3.9
- rasterio>=1.3
- requests>=2.27
- rio-vrt>=0.3
- scikit-learn>=0.23
- scipy>=1.5
- shapely>=2.0
- sphinx-autodoc-typehints
- sphinx>=7
- typeguard
- furo
- geopandas>=1.0
- lxml
- matplotlib>=3.5
- networkx>=2.5
- numpy>=1.22
- pandas>=1.4
- pre-commit
- pytest
- pytest-cov
- python>=3.9
- rasterio>=1.3
- requests>=2.27
- rio-vrt>=0.3
- scikit-learn>=0.23
- scipy>=1.5
- shapely>=2.0
- sphinx-autodoc-typehints
- sphinx>=7
- typeguard
36 changes: 18 additions & 18 deletions environments/tests/env-test-minimum-deps.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,22 +3,22 @@
# environments/environments.json and the requirements in pyproject.toml.
name: env-test-minimum-deps
channels:
- conda-forge
- conda-forge
dependencies:
- geopandas==1.0.*
- lxml
- matplotlib==3.5.*
- networkx==2.5.*
- numpy==1.22.*
- pandas==1.4.*
- pre-commit
- pytest
- pytest-cov
- python==3.9.*
- rasterio==1.3.*
- requests==2.27.*
- rio-vrt==0.3.*
- scikit-learn==0.23.*
- scipy==1.5.*
- shapely==2.0.*
- typeguard
- geopandas==1.0.*
- lxml
- matplotlib==3.5.*
- networkx==2.5.*
- numpy==1.22.*
- pandas==1.4.*
- pre-commit
- pytest
- pytest-cov
- python==3.9.*
- rasterio==1.3.*
- requests==2.27.*
- rio-vrt==0.3.*
- scikit-learn==0.23.*
- scipy==1.5.*
- shapely==2.0.*
- typeguard

0 comments on commit f79a817

Please sign in to comment.