add issue templates, ci linting and update pre-commit
This commit is contained in:
parent
35c069efe9
commit
6aeda2c48b
|
@ -1,14 +0,0 @@
|
||||||
name: check code
|
|
||||||
|
|
||||||
on:
|
|
||||||
push:
|
|
||||||
branches: [main, master]
|
|
||||||
|
|
||||||
pull_request:
|
|
||||||
branches: [main, master]
|
|
||||||
|
|
||||||
jobs:
|
|
||||||
check-code:
|
|
||||||
uses: actions/workflows/.gitea/workflows/check_python_hatch.yml@master
|
|
||||||
with:
|
|
||||||
run-tests: false
|
|
|
@ -0,0 +1,35 @@
|
||||||
|
---
|
||||||
|
name: Bug report
|
||||||
|
about: Create a report to help improve the tool
|
||||||
|
title: "[BUG] <short summary>"
|
||||||
|
labels: bug
|
||||||
|
assignees: olofvndrhr
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
**System info (please complete the following information):**
|
||||||
|
|
||||||
|
- Host: [e.g. Linux/Debian or Docker]
|
||||||
|
- `octodns-netbox-dns` version [e.g. v2.1.5]
|
||||||
|
- `netbox-dns` version [e.g. v2.1.5]
|
||||||
|
- Netbox version [e.g. v2.1.5]
|
||||||
|
|
||||||
|
**Describe the bug**
|
||||||
|
A clear and concise description of what the bug is.
|
||||||
|
|
||||||
|
**To Reproduce**
|
||||||
|
Steps to reproduce the behavior:
|
||||||
|
|
||||||
|
1. Go to '...'
|
||||||
|
2. Click on '....'
|
||||||
|
3. Scroll down to '....'
|
||||||
|
4. See error
|
||||||
|
|
||||||
|
**Expected behavior**
|
||||||
|
A clear and concise description of what you expected to happen.
|
||||||
|
|
||||||
|
**Screenshots**
|
||||||
|
If applicable, add screenshots to help explain your problem.
|
||||||
|
|
||||||
|
**Additional context**
|
||||||
|
Add any other context about the problem here.
|
|
@ -0,0 +1,20 @@
|
||||||
|
---
|
||||||
|
name: Feature request
|
||||||
|
about: Suggest an idea for this project
|
||||||
|
title: "[FEATURE] <short summary>"
|
||||||
|
labels: feature-request
|
||||||
|
assignees: olofvndrhr
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
**Is your feature request related to a problem? Please describe.**
|
||||||
|
A clear and concise description of what the problem is. Ex. I'm always frustrated when [...]
|
||||||
|
|
||||||
|
**Describe the solution you'd like**
|
||||||
|
A clear and concise description of what you want to happen.
|
||||||
|
|
||||||
|
**Describe alternatives you've considered**
|
||||||
|
A clear and concise description of any alternative solutions or features you've considered.
|
||||||
|
|
||||||
|
**Additional context**
|
||||||
|
Add any other context or screenshots about the feature request here.
|
|
@ -0,0 +1,28 @@
|
||||||
|
name: check code
|
||||||
|
|
||||||
|
on:
|
||||||
|
push:
|
||||||
|
branches: [main, master]
|
||||||
|
|
||||||
|
pull_request:
|
||||||
|
branches: [main, master]
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
check-code:
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
steps:
|
||||||
|
- name: checkout code
|
||||||
|
uses: actions/checkout@v3
|
||||||
|
|
||||||
|
- uses: actions/setup-python@v5
|
||||||
|
with:
|
||||||
|
python-version: "3.11"
|
||||||
|
|
||||||
|
- name: install hatch
|
||||||
|
run: pip install -U hatch
|
||||||
|
|
||||||
|
- name: test codestyle
|
||||||
|
run: hatch run lint:style
|
||||||
|
|
||||||
|
- name: test typing
|
||||||
|
run: hatch run lint:typing
|
|
@ -1,5 +0,0 @@
|
||||||
#!/bin/env bash
|
|
||||||
|
|
||||||
set -euxo pipefail
|
|
||||||
|
|
||||||
just format
|
|
35
justfile
35
justfile
|
@ -6,7 +6,7 @@ set shell := ["bash", "-uc"]
|
||||||
set dotenv-load
|
set dotenv-load
|
||||||
|
|
||||||
show_receipts:
|
show_receipts:
|
||||||
@just --list
|
just --list
|
||||||
|
|
||||||
show_system_info:
|
show_system_info:
|
||||||
@echo "=================================="
|
@echo "=================================="
|
||||||
|
@ -18,34 +18,41 @@ show_system_info:
|
||||||
@echo "=================================="
|
@echo "=================================="
|
||||||
|
|
||||||
setup:
|
setup:
|
||||||
@asdf install
|
asdf install
|
||||||
@lefthook install
|
lefthook install
|
||||||
|
|
||||||
create_venv:
|
create_venv:
|
||||||
@echo "creating venv"
|
@echo "creating venv"
|
||||||
@python3 -m pip install --upgrade pip setuptools wheel
|
python3 -m pip install --upgrade pip setuptools wheel
|
||||||
@python3 -m venv venv
|
python3 -m venv venv
|
||||||
|
|
||||||
install_deps:
|
install_deps:
|
||||||
@echo "installing dependencies"
|
@echo "installing dependencies"
|
||||||
@python3 -m hatch dep show requirements --project-only > /tmp/requirements.txt
|
python3 -m hatch dep show requirements --project-only > /tmp/requirements.txt
|
||||||
@pip3 install -r /tmp/requirements.txt
|
pip3 install -r /tmp/requirements.txt
|
||||||
|
|
||||||
install_deps_dev:
|
install_deps_dev:
|
||||||
@echo "installing dev dependencies"
|
@echo "installing dev dependencies"
|
||||||
@python3 -m hatch dep show requirements --project-only > /tmp/requirements.txt
|
python3 -m hatch dep show requirements --project-only > /tmp/requirements.txt
|
||||||
@python3 -m hatch dep show requirements --env-only >> /tmp/requirements.txt
|
python3 -m hatch dep show requirements --env-only >> /tmp/requirements.txt
|
||||||
@pip3 install -r /tmp/requirements.txt
|
pip3 install -r /tmp/requirements.txt
|
||||||
|
|
||||||
create_reqs:
|
create_reqs:
|
||||||
@echo "creating requirements"
|
@echo "creating requirements"
|
||||||
@pipreqs --force --savepath requirements.txt src/octodns_netbox_dns
|
pipreqs --force --savepath requirements.txt src/octodns_netbox_dns
|
||||||
|
|
||||||
lint:
|
lint:
|
||||||
just show_system_info
|
just show_system_info
|
||||||
@hatch run lint:style
|
hatch run lint:style
|
||||||
@hatch run lint:typing
|
hatch run lint:typing
|
||||||
|
|
||||||
format:
|
format:
|
||||||
just show_system_info
|
just show_system_info
|
||||||
@hatch run lint:fmt
|
hatch run lint:fmt
|
||||||
|
|
||||||
|
check:
|
||||||
|
just format
|
||||||
|
just lint
|
||||||
|
|
||||||
|
build:
|
||||||
|
hatch build --clean
|
||||||
|
|
12
lefthook.yml
12
lefthook.yml
|
@ -2,7 +2,13 @@ colors: true
|
||||||
no_tty: false
|
no_tty: false
|
||||||
|
|
||||||
pre-commit:
|
pre-commit:
|
||||||
scripts:
|
commands:
|
||||||
"format.sh":
|
01_ruff_check:
|
||||||
stage_fixed: true
|
stage_fixed: true
|
||||||
runner: bash
|
glob: "*.py"
|
||||||
|
run: ruff check --fix-only --exit-zero --silent {all_files}
|
||||||
|
|
||||||
|
02_ruff_format:
|
||||||
|
stage_fixed: true
|
||||||
|
glob: "*.py"
|
||||||
|
run: ruff format {all_files}
|
||||||
|
|
Loading…
Reference in New Issue