Skip to content

Commit

Permalink
πŸš€ Initial commit
Browse files Browse the repository at this point in the history
  • Loading branch information
jpbede committed Jan 19, 2024
1 parent 1ad3df9 commit cf6bdb0
Show file tree
Hide file tree
Showing 19 changed files with 2,645 additions and 0 deletions.
3 changes: 3 additions & 0 deletions .github/FUNDING.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
---
github:
- jpbede
85 changes: 85 additions & 0 deletions .github/labels.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,85 @@
---
- name: "breaking-change"
color: ee0701
description: "A breaking change for existing users."
- name: "bugfix"
color: ee0701
description: "Inconsistencies or issues which will cause a problem for users or implementers."
- name: "documentation"
color: 0052cc
description: "Solely about the documentation of the project."
- name: "enhancement"
color: 1d76db
description: "Enhancement of the code, not introducing new features."
- name: "refactor"
color: 1d76db
description: "Improvement of existing code, not introducing new features."
- name: "performance"
color: 1d76db
description: "Improving performance, not introducing new features."
- name: "new-feature"
color: 0e8a16
description: "New features or options."
- name: "maintenance"
color: 2af79e
description: "Generic maintenance tasks."
- name: "ci"
color: 1d76db
description: "Work that improves the continue integration."
- name: "dependencies"
color: 1d76db
description: "Upgrade or downgrade of project dependencies."

- name: "in-progress"
color: fbca04
description: "Issue is currently being resolved by a developer."
- name: "stale"
color: fef2c0
description: "There has not been activity on this issue or PR for quite some time."
- name: "no-stale"
color: fef2c0
description: "This issue or PR is exempted from the stable bot."

- name: "security"
color: ee0701
description: "Marks a security issue that needs to be resolved asap."
- name: "incomplete"
color: fef2c0
description: "Marks a PR or issue that is missing information."
- name: "invalid"
color: fef2c0
description: "Marks a PR or issue that is missing information."

- name: "beginner-friendly"
color: 0e8a16
description: "Good first issue for people wanting to contribute to the project."
- name: "help-wanted"
color: 0e8a16
description: "We need some extra helping hands or expertise in order to resolve this."

- name: "hacktoberfest"
description: "Issues/PRs are participating in the Hacktoberfest."
color: fbca04
- name: "hacktoberfest-accepted"
description: "Issues/PRs are participating in the Hacktoberfest."
color: fbca04

- name: "priority-critical"
color: ee0701
description: "This should be dealt with ASAP. Not fixing this issue would be a serious error."
- name: "priority-high"
color: b60205
description: "After critical issues are fixed, these should be dealt with before any further issues."
- name: "priority-medium"
color: 0e8a16
description: "This issue may be useful, and needs some attention."
- name: "priority-low"
color: e4ea8a
description: "Nice addition, maybe... someday..."

- name: "major"
color: b60205
description: "This PR causes a major version bump in the version number."
- name: "minor"
color: 0e8a16
description: "This PR causes a minor version bump in the version number."
57 changes: 57 additions & 0 deletions .github/release-drafter.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,57 @@
---
name-template: "v$RESOLVED_VERSION"
tag-template: "v$RESOLVED_VERSION"
change-template: "- $TITLE @$AUTHOR (#$NUMBER)"
sort-direction: ascending

categories:
- title: "🚨 Breaking changes"
labels:
- "breaking-change"
- title: "✨ New features"
labels:
- "new-feature"
- title: "πŸ› Bug fixes"
labels:
- "bugfix"
- title: "πŸš€ Enhancements"
labels:
- "enhancement"
- "refactor"
- "performance"
- title: "🧰 Maintenance"
labels:
- "maintenance"
- "ci"
- title: "πŸ“š Documentation"
labels:
- "documentation"
- title: "⬆️ Dependency updates"
labels:
- "dependencies"

version-resolver:
major:
labels:
- "major"
- "breaking-change"
minor:
labels:
- "minor"
- "new-feature"
patch:
labels:
- "bugfix"
- "chore"
- "ci"
- "dependencies"
- "documentation"
- "enhancement"
- "performance"
- "refactor"
default: patch

template: |
## What’s changed
$CHANGES
48 changes: 48 additions & 0 deletions .github/renovate.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
{
"$schema": "https://docs.renovatebot.com/renovate-schema.json",
"schedule": ["before 2am"],
"rebaseWhen": "behind-base-branch",
"dependencyDashboard": true,
"labels": ["dependencies", "no-stale"],
"lockFileMaintenance": {
"enabled": true,
"automerge": true
},
"commitMessagePrefix": "⬆️",
"packageRules": [
{
"matchManagers": ["poetry"],
"addLabels": ["python"]
},
{
"matchManagers": ["poetry"],
"matchDepTypes": ["dev"],
"rangeStrategy": "pin"
},
{
"matchManagers": ["poetry"],
"matchUpdateTypes": ["minor", "patch"],
"automerge": true
},
{
"matchManagers": ["npm", "nvm"],
"addLabels": ["javascript"],
"rangeStrategy": "pin"
},
{
"matchManagers": ["npm", "nvm"],
"matchUpdateTypes": ["minor", "patch"],
"automerge": true
},
{
"matchManagers": ["github-actions"],
"addLabels": ["github_actions"],
"rangeStrategy": "pin"
},
{
"matchManagers": ["github-actions"],
"matchUpdateTypes": ["minor", "patch"],
"automerge": true
}
]
}
177 changes: 177 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,177 @@
---
name: CI

# yamllint disable-line rule:truthy
on:
push:
branches:
- main
pull_request:
workflow_dispatch:

env:
DEFAULT_PYTHON: "3.11"

jobs:
codespell:
name: codespell
runs-on: ubuntu-latest
steps:
- name: ‡️ Check out code from GitHub
uses: actions/[email protected]
- name: πŸ— Set up Poetry
run: pipx install poetry
- name: πŸ— Set up Python ${{ env.DEFAULT_PYTHON }}
id: python
uses: actions/[email protected]
with:
python-version: ${{ env.DEFAULT_PYTHON }}
cache: "poetry"
- name: πŸ— Install workflow dependencies
run: |
poetry config virtualenvs.create true
poetry config virtualenvs.in-project true
- name: πŸ— Install Python dependencies
run: poetry install --no-interaction
- name: πŸš€ Check code for common misspellings
run: poetry run pre-commit run codespell --all-files

ruff:
name: Ruff
runs-on: ubuntu-latest
steps:
- name: ‡️ Check out code from GitHub
uses: actions/[email protected]
- name: πŸ— Set up Poetry
run: pipx install poetry
- name: πŸ— Set up Python ${{ env.DEFAULT_PYTHON }}
id: python
uses: actions/[email protected]
with:
python-version: ${{ env.DEFAULT_PYTHON }}
cache: "poetry"
- name: πŸ— Install workflow dependencies
run: |
poetry config virtualenvs.create true
poetry config virtualenvs.in-project true
- name: πŸ— Install Python dependencies
run: poetry install --no-interaction
- name: πŸš€ Run ruff linter
run: poetry run ruff check --output-format=github .
- name: πŸš€ Run ruff formatter
run: poetry run ruff format --check .

pre-commit-hooks:
name: pre-commit-hooks
runs-on: ubuntu-latest
steps:
- name: ‡️ Check out code from GitHub
uses: actions/[email protected]
- name: πŸ— Set up Poetry
run: pipx install poetry
- name: πŸ— Set up Python ${{ env.DEFAULT_PYTHON }}
id: python
uses: actions/[email protected]
with:
python-version: ${{ env.DEFAULT_PYTHON }}
cache: "poetry"
- name: πŸ— Install workflow dependencies
run: |
poetry config virtualenvs.create true
poetry config virtualenvs.in-project true
- name: πŸ— Install Python dependencies
run: poetry install --no-interaction
- name: πŸš€ Check Python AST
run: poetry run pre-commit run check-ast --all-files
- name: πŸš€ Check for case conflicts
run: poetry run pre-commit run check-case-conflict --all-files
- name: πŸš€ Check docstring is first
run: poetry run pre-commit run check-docstring-first --all-files
- name: πŸš€ Check that executables have shebangs
run: poetry run pre-commit run check-executables-have-shebangs --all-files
- name: πŸš€ Check JSON files
run: poetry run pre-commit run check-json --all-files
- name: πŸš€ Check for merge conflicts
run: poetry run pre-commit run check-merge-conflict --all-files
- name: πŸš€ Check for broken symlinks
run: poetry run pre-commit run check-symlinks --all-files
- name: πŸš€ Check TOML files
run: poetry run pre-commit run check-toml --all-files
- name: πŸš€ Check XML files
run: poetry run pre-commit run check-xml --all-files
- name: πŸš€ Check YAML files
run: poetry run pre-commit run check-yaml --all-files
- name: πŸš€ Detect Private Keys
run: poetry run pre-commit run detect-private-key --all-files
- name: πŸš€ Check End of Files
run: poetry run pre-commit run end-of-file-fixer --all-files
- name: πŸš€ Trim Trailing Whitespace
run: poetry run pre-commit run trailing-whitespace --all-files

pylint:
name: pylint
runs-on: ubuntu-latest
steps:
- name: ‡️ Check out code from GitHub
uses: actions/[email protected]
- name: πŸ— Set up Poetry
run: pipx install poetry
- name: πŸ— Set up Python ${{ env.DEFAULT_PYTHON }}
id: python
uses: actions/[email protected]
with:
python-version: ${{ env.DEFAULT_PYTHON }}
cache: "poetry"
- name: πŸ— Install workflow dependencies
run: |
poetry config virtualenvs.create true
poetry config virtualenvs.in-project true
- name: πŸ— Install Python dependencies
run: poetry install --no-interaction
- name: πŸš€ Run pylint
run: poetry run pre-commit run pylint --all-files

yamllint:
name: yamllint
runs-on: ubuntu-latest
steps:
- name: ‡️ Check out code from GitHub
uses: actions/[email protected]
- name: πŸ— Set up Poetry
run: pipx install poetry
- name: πŸ— Set up Python ${{ env.DEFAULT_PYTHON }}
id: python
uses: actions/[email protected]
with:
python-version: ${{ env.DEFAULT_PYTHON }}
cache: "poetry"
- name: πŸ— Install workflow dependencies
run: |
poetry config virtualenvs.create true
poetry config virtualenvs.in-project true
- name: πŸ— Install Python dependencies
run: poetry install --no-interaction
- name: πŸš€ Run yamllint
run: poetry run yamllint .
mypy:
name: mypy
runs-on: ubuntu-latest
steps:
- name: ‡️ Check out code from GitHub
uses: actions/[email protected]
- name: πŸ— Set up Poetry
run: pipx install poetry
- name: πŸ— Set up Python ${{ env.DEFAULT_PYTHON }}
id: python
uses: actions/[email protected]
with:
python-version: ${{ env.DEFAULT_PYTHON }}
cache: "poetry"
- name: πŸ— Install workflow dependencies
run: |
poetry config virtualenvs.create true
poetry config virtualenvs.in-project true
- name: πŸ— Install dependencies
run: poetry install --no-interaction
- name: πŸš€ Run mypy
run: poetry run mypy src tests
23 changes: 23 additions & 0 deletions .github/workflows/labels.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
---
name: Sync labels

# yamllint disable-line rule:truthy
on:
push:
branches:
- main
paths:
- .github/labels.yml
workflow_dispatch:

jobs:
labels:
name: ♻️ Sync labels
runs-on: ubuntu-latest
steps:
- name: ‡️ Check out code from GitHub
uses: actions/[email protected]
- name: πŸš€ Run Label Syncer
uses: micnncim/[email protected]
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
Loading

0 comments on commit cf6bdb0

Please sign in to comment.