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 pre-commit hooks, acto on them, split files into multiple smaller #7

Draft
wants to merge 15 commits into
base: main
Choose a base branch
from
Draft
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
6 changes: 6 additions & 0 deletions .flake8
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
[flake8]
max_line_length=300
in-place = true
# ignore old opposite of W504
ignore=W503,
E266,
7 changes: 7 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
__pycache__
*.log
gui.ini
.idea
data/*.geojson
data/index_style.qml
symbology-style.db
3 changes: 3 additions & 0 deletions .isort.cfg
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
[settings]
multi_line_output=5
overwrite_in_place=true
3 changes: 3 additions & 0 deletions .pep8
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
[pycodestyle]
max_line_length=300
in-place = true
52 changes: 52 additions & 0 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
# See https://pre-commit.com for more information
# See https://pre-commit.com/hooks.html for more hooks
repos:
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v4.1.0
hooks:
- id: trailing-whitespace
- id: check-yaml
- id: check-added-large-files
- id: check-ast
- id: check-case-conflict
- id: check-docstring-first
- id: check-executables-have-shebangs
- id: check-json
- id: check-shebang-scripts-are-executable
- id: check-merge-conflict
- id: check-xml
- id: mixed-line-ending
- id: requirements-txt-fixer
- repo: https://github.com/PyCQA/flake8
rev: '4.0.1'
hooks:
- id: flake8
- repo: https://github.com/pycqa/isort
rev: '5.12.0'
hooks:
- id: isort
name: isort
- repo: https://github.com/pre-commit/mirrors-mypy
rev: 'v0.931' # Use the sha / tag you want to point at
hooks:
- id: mypy
args: [
--disallow-untyped-defs,
--disallow-incomplete-defs,
--disallow-untyped-calls,
--disallow-any-explicit,
--disallow-any-generics,
--disallow-subclassing-any,
--check-untyped-defs,
--warn-redundant-casts,
--warn-unused-ignores,
--warn-return-any,
--warn-unreachable,
--disallow-redefinition,
--strict-equality,
--strict,
--show-error-context,
--show-column-numbers,
# --show-error-code-links,
# --pretty
]
13 changes: 13 additions & 0 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
{
"cSpell.words": [
"dooring",
"extractbyexpression",
"malus",
"prot",
"qgis",
"selectbyexpression",
"selectbylocation",
"sharrows",
"unhewn"
]
}
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ A Python script for QGIS that generates a cycling quality index from OpenStreetM
* Calculation of index values and factors for the mentioned property groups and derivation of a total index

### How to use this script
1. Run [Overpass-Query](https://overpass-turbo.eu/s/1G3t) for for the desired area/region to get road and way network suitable for cycling
1. Run [Overpass-Query](https://overpass-turbo.eu/s/1G3t) for for the desired area/region to get road and way network suitable for cycling
2. Export result as GeoJSON to 'data/way_import.geojson'
3. Run this python script in QGIS
1. "Plugins" => "Python Console"
Expand Down
6 changes: 6 additions & 0 deletions bootstrap.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
#!/usr/bin/env python3
import imp

import cycling_quality_index

imp.reload(cycling_quality_index) # to force QGis to see changes in that file
Loading