Skip to content

Commit

Permalink
First version
Browse files Browse the repository at this point in the history
  • Loading branch information
nbonnotte committed Jul 1, 2024
1 parent c31531a commit ee96210
Show file tree
Hide file tree
Showing 72 changed files with 16,693 additions and 4 deletions.
27 changes: 27 additions & 0 deletions .github/ISSUE_TEMPLATE/bug_report.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
---
name: Bug report
about: Problems and issues with the code in this repository
title: ''
labels: bug
assignees: ''

---

## Environment

**Version**:

**Environment**:
- **OS**:
- **Other**:


## Bug

### What happened

### What you expected to happen

### How to reproduce it

### More details
1 change: 1 addition & 0 deletions .github/ISSUE_TEMPLATE/config.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
blank_issues_enabled: false
14 changes: 14 additions & 0 deletions .github/ISSUE_TEMPLATE/feature_request.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
---
name: Feature request
about: Suggest an idea for this project or its docs
title: ''
labels: enhancement
assignees: ''

---

## Description

**Use Case**

**Related Issue(s)**
16 changes: 16 additions & 0 deletions .github/ISSUE_TEMPLATE/requirement-issue.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
---
name: Requirement issue
about: Questions and issues with the legal requirements
title: ''
labels: requirements
assignees: ''

---

## Requirement issue

This concerns:
- [ ] The OECD DPI initial requirements
- [ ] The DGFiP DAC7 revised requirements for France

**Description**
15 changes: 15 additions & 0 deletions .github/pull_request_template.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
# Description
The description of the main changes of your pull request

# Related Issue(s)
<!---
For example:
- closes #1
--->

# Documentation

<!---
Share links to useful documentation
--->
14 changes: 14 additions & 0 deletions renovate.json5 → .github/renovate.json
Original file line number Diff line number Diff line change
Expand Up @@ -24,5 +24,19 @@
"matchPackageNames": ["psf/black-pre-commit-mirror"],
"customChangelogUrl": "https://github.com/psf/black"
}
],
"regexManagers": [
{
"description": "Update poetry",
"fileMatch": [
"^.+\\.yml$",
"^Dockerfile$"
],
"matchStrings": [
"pip install( --upgrade)? poetry==(?<currentValue>\\S+?)\\s"
],
"depNameTemplate": "poetry",
"datasourceTemplate": "pypi"
}
]
}
29 changes: 29 additions & 0 deletions .github/workflows/docker.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
name: docker
on:
pull_request:
branches: [main]
push:
branches: [main]
jobs:
tests:
name: Tests
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@a5ac7e51b41094c92402da3b24376905380afc29 # v4

- name: Install poetry
run: pip install poetry==1.8.3

- uses: actions/setup-python@82c7e631bb3cdc910f68e0081d67478d79c6982d # v5
with:
python-version: '3.12'
cache: 'poetry'

- name: Install local project
run: make init

- name: Unit tests
run: make test-unit

- name: Run end-to-end tests
run: make test-e2e
15 changes: 15 additions & 0 deletions .github/workflows/mlc.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
name: mlc
on:
pull_request:
branches: [main]
push:
branches: [main]
schedule:
- cron: "0 0 * * 1"
jobs:
mlc:
name: Broken Links Check
runs-on: ubuntu-latest
steps:
- name: Markup Link Checker (mlc)
uses: becheran/mlc@b0cb310fda856cf4a7734bfa6bca20029ffcf89b # v0.17.1
33 changes: 33 additions & 0 deletions .github/workflows/pre-commit.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
name: pre-commit
on:
pull_request:
branches: [main]
push:
branches: [main]
jobs:
style-check:
name: Style Check
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@a5ac7e51b41094c92402da3b24376905380afc29 # v4

- name: Install pre-commit
run: pip install poetry==1.8.3

- uses: actions/setup-python@82c7e631bb3cdc910f68e0081d67478d79c6982d # v5
with:
python-version: '3.12'
cache: 'poetry'

- name: Install dependencies
run: poetry install

- uses: actions/cache@0c45773b623bea8c8e75f6c82b208c3cf94ea4f9 # v4
env:
cache-name: cache-pre-commit
with:
path: ~/.cache/pre-commit
key: ${{ env.cache-name }}-${{ hashFiles('.pre-commit-config.yaml') }}

- name: Run pre-commit
run: SKIP=poetry-lock poetry run pre-commit run --show-diff-on-failure --all-files
15 changes: 15 additions & 0 deletions .github/workflows/semgrep.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
name: semgrep
on:
pull_request:
branches: [main]
push:
branches: [main]
jobs:
static:
name: Static Check
runs-on: ubuntu-latest
container:
image: returntocorp/semgrep
steps:
- uses: actions/checkout@a5ac7e51b41094c92402da3b24376905380afc29 # v4
- run: semgrep ci --config=p/default
21 changes: 21 additions & 0 deletions .github/workflows/trufflehog.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
name: trufflehog
on:
pull_request:
branches: [main]
push:
branches: [main]
jobs:
scan:
name: Leaked Secrets Scan
runs-on: ubuntu-latest
steps:

- name: Checkout code
uses: actions/checkout@a5ac7e51b41094c92402da3b24376905380afc29 # v4
with:
fetch-depth: 0

- name: Secret Scanning
uses: trufflesecurity/trufflehog@main
with:
extra_args: --only-verified
17 changes: 17 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
__pycache__
.coverage
.mypy_cache
.pytest_cache
.ruff_cache
*.json
*.xml
*.xml.gz
*.xml.gz.gpg
!.github/*.json
!schemas/**/*.json
!examples/**/*.json
!examples/**/*.xml
/cli/src/dac7/schemas
/dist
/output
/tests
83 changes: 83 additions & 0 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,83 @@
default_stages: [commit]

default_language_version:
python: python3.12

repos:
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v4.6.0
hooks:
- id: trailing-whitespace
- id: end-of-file-fixer
- id: check-json
- id: check-toml
- id: check-xml
- id: check-yaml
- id: check-added-large-files

- repo: https://github.com/pre-commit/pygrep-hooks
rev: 'v1.10.0'
hooks:
- id: python-check-blanket-noqa
- id: python-check-blanket-type-ignore
- id: python-check-mock-methods
- id: python-no-eval
- id: python-use-type-annotations

- repo: local
hooks:
- id: python-check-blanket-nosec
name: check blanket nosec
entry: '# nosec(?!: (B[0-9]{3} ?)+( +#.*)*$)'
language: pygrep
types: [python]

- repo: https://github.com/shellcheck-py/shellcheck-py
rev: 'v0.10.0.1'
hooks:
- id: shellcheck
args: ['-x']

- repo: https://github.com/astral-sh/ruff-pre-commit
rev: 'v0.4.8'
hooks:
- id: ruff
args: ['--exit-non-zero-on-fix']

- repo: https://github.com/psf/black-pre-commit-mirror
rev: '24.4.2'
hooks:
- id: black

- repo: https://github.com/PyCQA/bandit
rev: '1.7.9'
hooks:
- id: bandit
additional_dependencies: ['.[toml]']
args: ['-c', 'pyproject.toml']

- repo: local
hooks:
- id: mypy
name: mypy
files: 'cli'
entry: poetry run mypy
language: system
types: [python]
require_serial: true

- repo: https://github.com/rubik/xenon/
rev: 'v0.9.1'
hooks:
- id: xenon
name: xenon
files: 'cli'
args: ["--max-average=A", "--max-modules=A", "--max-absolute=A"]

- repo: https://github.com/python-poetry/poetry
rev: '1.8.3'
hooks:
- id: poetry-check
- id: poetry-lock
args: ["--no-update"]
- id: poetry-install
Loading

0 comments on commit ee96210

Please sign in to comment.