Skip to content

Commit

Permalink
Add various config files
Browse files Browse the repository at this point in the history
  • Loading branch information
sjib committed May 7, 2024
1 parent 849c966 commit 32ecd81
Show file tree
Hide file tree
Showing 4 changed files with 140 additions and 0 deletions.
12 changes: 12 additions & 0 deletions .env.example
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
# Copy this file to .env
# ----------------------
# Define POSTGRES PORT for Docker when calling datamodel/scripts/run-docker.sh
TWW_PG_PORT=5432

QGIS_TEST_VERSION

POSTGIS_IMAGE=postgis/postgis:14-3.4

# fix access rights for schemaspy
UID=1000
GID=1001
75 changes: 75 additions & 0 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,75 @@
repos:
- repo: local
hooks:
- id: banned-words
name: Check Banned Words
entry: ./scripts/banned-words.sh
language: script

# Fix end of files
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v4.5.0
hooks:
- id: trailing-whitespace
exclude: .*\.qgs
- id: end-of-file-fixer
exclude: .*\.qgs
- id: mixed-line-ending
exclude: .*\.qgs
args:
- '--fix=lf'

# Remove unused imports/variables
- repo: https://github.com/PyCQA/autoflake
rev: v2.3.1
hooks:
- id: autoflake
args:
- "--in-place"
- "--remove-all-unused-imports"
- "--remove-unused-variables"

# Sort imports
- repo: https://github.com/pycqa/isort
rev: "5.13.2"
hooks:
- id: isort
args: ["--profile", "black"]

# Black formatting
- repo: https://github.com/psf/black
rev: "24.3.0"
hooks:
- id: black
args: ["--line-length=99"]

# tool to automatically upgrade syntax for newer versions of the language
- repo: https://github.com/asottile/pyupgrade
rev: v3.15.2
hooks:
- id: pyupgrade
args: [--py37-plus]

# Lint files
- repo: https://github.com/pycqa/flake8
rev: "7.0.0"
hooks:
- id: flake8
args: [
"--max-line-length=115",
# ignore long comments (E501), as long lines are formatted by black
"--ignore=E501,E203,W503",
]

# # Static type-checking with mypy
# - repo: https://github.com/pre-commit/mirrors-mypy
# rev: 'v1.5.1'
# hooks:
# - id: mypy
# additional_dependencies: [types-pytz, types-Deprecated, types-PyYAML, types-requests, types-tabulate, types-jsonschema, django-stubs]
# pass_filenames: false
# entry: bash -c 'mypy -p docker-qgis -p docker-app "$@"' --

ci:
autofix_prs: true
autoupdate_schedule: quarterly
7 changes: 7 additions & 0 deletions .qgis-plugin-ci
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
plugin_path: plugin/teksi_distance_heating
github_organization_slug: TEKSI
project_slug: distance_heating

transifex_organization: teksi
transifex_project: tdh-plugin
transifex_resource: tdh-plugin
46 changes: 46 additions & 0 deletions docker-compose.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
version: '3'

services:
db:
build:
context: .
dockerfile: datamodel/.docker/Dockerfile
args:
POSTGIS_IMAGE: ${POSTGIS_IMAGE:-postgis/postgis:14-3.4}
image: teksi/tdh:${DOCKER_TAG:-unstable}
working_dir: /src
volumes:
- .:/src
ports:
# making the postgres database accessible for debugging
- ${TDH_PG_PORT:-5432}:${TDH_PG_PORT:-5432}

qgis:
build:
context: .
dockerfile: plugin/.docker/Dockerfile
args:
QGIS_TEST_VERSION: ${QGIS_TEST_VERSION:-latest}
tty: true
volumes:
- .:/usr/src
links:
- db
profiles:
- qgis

schemaspy:
image: schemaspy/schemaspy
volumes:
- ./datamodel/schemaspy:/output
- ./datamodel/schemaspy.properties:/schemaspy.properties
depends_on:
- db
network_mode: "service:db"
command: [
"-configFile",
"/schemaspy.properties"
]
user: "${UID}:${GID}"
profiles:
- schemaspy

0 comments on commit 32ecd81

Please sign in to comment.