Skip to content

Commit

Permalink
chore: Update project template to sphinx-notes/cookiecutter@48631580
Browse files Browse the repository at this point in the history
  • Loading branch information
SilverRainZ committed Aug 18, 2024
1 parent 02a110c commit 24e0a5f
Show file tree
Hide file tree
Showing 6 changed files with 40 additions and 3 deletions.
2 changes: 1 addition & 1 deletion .cruft.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"template": "https://github.com/sphinx-notes/template",
"commit": "0db2ed864acc101a2ee90a3bf94b54b9f46473cf",
"commit": "4863158051bf17ac253d631aac0521e8513977dd",
"checkout": null,
"context": {
"cookiecutter": {
Expand Down
9 changes: 9 additions & 0 deletions .github/workflows/lint.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
name: Ruff
on: [ push, pull_request ]

jobs:
ruff:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: chartboost/ruff-action@v1
6 changes: 6 additions & 0 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
repos:
- repo: https://github.com/astral-sh/ruff-pre-commit
rev: v0.6.1
hooks:
- id: ruff
- id: ruff-format
22 changes: 20 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -7,21 +7,35 @@ MAKE = make
PY = python3
RM = rm -rf
GIT = git
OPEN = xdg-open

# Build sphinx documentation.
.PHONY: docs
docs:
$(MAKE) -C docs/

# View sphinx HTML documentation in browser.
.PHONY: view
view:
$(OPEN) docs/_build/html/index.html

.PHONY: clean
clean:
$(MAKE) -C docs/ clean
$(RM) dist/

.PHONY: clean
fmt:
ruff format src/

# Run unittest.
.PHONY: test
test:
$(PY) -m unittest discover -s tests -v

# Build distribution package, for "install" or "upload".
.PHONY: dist
dist: pyproject.toml
$(RM) dist/ # clean up old dist
dist: pyproject.toml clean
$(PY) -m build

# Install distribution package to user directory.
Expand Down Expand Up @@ -62,7 +76,11 @@ bump-version:
@echo -n "Please enter the version to bump: "
@read version && $(PY) -m cruft update --variables-to-update "{ \"version\" : \"$$version\" }"

# EXTRA TARGETS START

# Usage: make cli args=--help
.PHONY: cli
cli:
$(PY) ./utils/cli.py --config ./utils/conf.py $(args)

# EXTRA TARGETS END
2 changes: 2 additions & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,8 @@ dev = [
"build",
"twine",
"cruft",
"ruff",
"pre-commit"
]
test = [
"pytest",
Expand Down
2 changes: 2 additions & 0 deletions ruff.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
[format]
quote-style = "single"

0 comments on commit 24e0a5f

Please sign in to comment.