Skip to content

Commit

Permalink
Initial commit
Browse files Browse the repository at this point in the history
  • Loading branch information
paulfouquet committed May 31, 2022
0 parents commit 41c6176
Show file tree
Hide file tree
Showing 19 changed files with 1,768 additions and 0 deletions.
16 changes: 16 additions & 0 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
version: 2
updates:
- package-ecosystem: "github-actions"
directory: "/"
schedule:
interval: daily
commit-message:
prefix: "build(deps)"
- package-ecosystem: pip
directory: "/"
schedule:
interval: daily
open-pull-requests-limit: 10
commit-message:
prefix: "build(deps)"
prefix-development: "build(deps-dev)"
57 changes: 57 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,57 @@
name: Build

on:
push:
branches:
- master
pull_request:

jobs:
build:
strategy:
fail-fast: false
matrix:
os: [ubuntu-18.04, ubuntu-20.04]
python: [3.6, 3.7, 3.8, 3.9]
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v3
with:
fetch-depth: 0
- name: Setup Python ${{ matrix.python }}
uses: actions/setup-python@v3
with:
python-version: ${{ matrix.python }}
- uses: actions/cache@v3
with:
path: ~/.cache/pip
key: ${{ matrix.os }}-pip-${{ secrets.CACHE_SEED }}-${{ matrix.python }}-${{ hashFiles('./poetry.lock') }}
restore-keys: ${{ matrix.os }}-pip-${{ secrets.CACHE_SEED }}-${{ matrix.python }}-
- name: Install
run: |
python -m pip install --upgrade pip
python -m pip install poetry
python -m poetry install
- name: Lint Last Commit
if: github.event_name == 'push'
run: |
poetry run gitlint
- name: Lint All Commits on Pull Request
if: github.event_name == 'pull_request'
run: |
poetry run gitlint --commits "origin/${{ github.base_ref }}...HEAD"
- name: Format
run: |
poetry run pre-commit run --all-files
- name: Test
run: |
poetry run coverage run --module pytest
- name: Verify test coverage
run: |
poetry run coverage html
- name: Archive code coverage report
uses: actions/upload-artifact@v3
with:
name: code-coverage-report
path: htmlcov
if: ${{ failure() }}
34 changes: 34 additions & 0 deletions .github/workflows/mutation-testing.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
name: Mutation testing

on: workflow_dispatch

jobs:
mutation-tests:
runs-on: ubuntu-20.04
steps:
- uses: actions/checkout@v3
- name: Setup Python
uses: actions/setup-python@v3
with:
python-version: 3.9
- uses: actions/cache@v3
with:
path: ~/.cache/pip
key: ${{ runner.os }}-pip-${{ secrets.CACHE_SEED }}-${{ env.PYTHON_VERSION }}-${{ hashFiles('./poetry.lock') }}
restore-keys: ${{ runner.os }}-pip-${{ secrets.CACHE_SEED }}-${{ env.PYTHON_VERSION }}-
- name: Install
run: |
python -m pip install --upgrade pip
python -m pip install poetry
python -m poetry install
- name: Run mutation tests
run: poetry run mutmut run
- name: Create mutation test report
run: poetry run mutmut junitxml > mutmut.xml
if: ${{ failure() }}
- name: Archive mutation test report
uses: actions/upload-artifact@v3
with:
name: mutation-test-report
path: mutmut.xml
if: ${{ failure() }}
12 changes: 12 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
/.coverage
/html/
/htmlcov/
/.idea
/.mutmut-cache
/mutmut.xml
*.pyc
__pycache__
/.pytest_cache
Thumbs.db
/.venv
/.vscode
21 changes: 21 additions & 0 deletions .gitlint
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
# Configuration file for gitlint, used via pre-commit
# Configuration docs: http://jorisroovers.github.io/gitlint/configuration/
# Default rules: https://github.com/jorisroovers/gitlint/blob/master/docs/rules.md

[general]
# Ignore certain rules, you can reference them by their id or by their full name
ignore=body-is-missing, body-max-line-length

# Enable community contributed rule for conventional commits
contrib=contrib-title-conventional-commits

[title-max-length]
line-length=72

# [title-match-regex]
# Uncomment to ensure that there is an issue referenced in every commit title
# regex=^.*?#[0-9]+\b.*?$

[contrib-title-conventional-commits]
# Specify allowed commit types. For details see: https://www.conventionalcommits.org/
types = build, chore, ci, docs, feat, fix, perf, refactor, revert, style, test
13 changes: 13 additions & 0 deletions .kodiak.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
version = 1

[approve]
auto_approve_usernames = ["dependabot"]

[merge]
method = "squash"
automerge_label = "automerge 🚀"

[merge.message]
title = "pull_request_title"
include_coauthors = true
include_pull_request_url = true
56 changes: 56 additions & 0 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
# Configuration file for pre-commit (https://pre-commit.com/)
# Please run `pre-commit run --all-files` when adding or changing entries.

repos:
- repo: local
hooks:
- id: black
name: black
entry: black
language: system
stages: [commit]
types: [python]

- id: gitlint
name: gitlint
entry: gitlint
args: [--msg-filename]
language: system
stages: [commit-msg]

- id: isort
name: isort
entry: isort
language: system
stages: [commit]
types: [python]

- id: mypy
name: mypy
entry: mypy
args: [--no-incremental]
language: system
stages: [commit]
types: [python]
require_serial: true

- id: pretty-format-toml
name: Pretty format TOML
entry: pretty-format-toml
args: [--autofix]
language: system
stages: [commit]
types: [toml]

- id: pylint
name: pylint
entry: pylint
language: system
stages: [commit]
types: [python]

- repo: https://github.com/pre-commit/mirrors-prettier
rev: a99a3fbe79a9d346cabd02a5e167ad0edafe616b # v2.3.0
hooks:
- id: prettier
stages: [commit]
1 change: 1 addition & 0 deletions .python-version
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
3.9.6
21 changes: 21 additions & 0 deletions LICENSE
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
MIT License

Copyright (c) 2019 Land Information New Zealand

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
Loading

0 comments on commit 41c6176

Please sign in to comment.