Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
37 changes: 37 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
name: CI

on:
push:
branches: [main]
pull_request:
branches: [main]

env:
DASHVERSION: "23.0.2"

jobs:
pre-commit:
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [ubuntu-latest, macos-latest]
steps:
- uses: actions/checkout@v4

- uses: actions/setup-python@v5
with:
python-version: "3.14"
allow-prereleases: true

- name: Cache dashd
uses: actions/cache@v4
with:
path: .dashd-cache
key: dashd-${{ runner.os }}-${{ env.DASHVERSION }}

- name: Setup dashd
env:
CACHE_DIR: ${{ github.workspace }}/.dashd-cache
run: python contrib/setup-dashd.py >> "$GITHUB_ENV"

- uses: pre-commit/action@v3.0.1
50 changes: 50 additions & 0 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
repos:
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v5.0.0
hooks:
- id: trailing-whitespace
exclude: '\.md$'
- id: end-of-file-fixer
exclude: '^data/'
- id: check-yaml
args: ['--allow-multiple-documents']
- id: check-json
exclude: '^data/'
- id: check-toml
- id: check-merge-conflict
- id: mixed-line-ending
args: ['--fix=lf']
- id: check-added-large-files
args: ['--maxkb=1000']
- id: check-case-conflict
- id: check-executables-have-shebangs
- id: check-shebang-scripts-are-executable

- repo: https://github.com/rhysd/actionlint
rev: v1.7.9
hooks:
- id: actionlint

- repo: https://github.com/crate-ci/typos
rev: v1.31.1
hooks:
- id: typos
args: ['--write-changes']
exclude: '^data/'

- repo: https://github.com/astral-sh/ruff-pre-commit
rev: v0.15.0
hooks:
- id: ruff-format
- id: ruff-check
args: [--fix]

- repo: local
hooks:
- id: pytest
name: pytest
entry: python3 -m pytest
language: python
additional_dependencies: [pytest]
pass_filenames: false
always_run: true
Empty file modified contrib/setup-dashd.py
100644 → 100755
Empty file.
Empty file modified export_wallets.py
100644 → 100755
Empty file.
28 changes: 28 additions & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
[tool.ruff]
target-version = "py312"
line-length = 120

[tool.ruff.lint]
select = [
"E", # pycodestyle errors
"F", # pyflakes
"W", # pycodestyle warnings
"I", # isort
"UP", # pyupgrade
"B", # flake8-bugbear
"SIM", # flake8-simplify
]
ignore = [
"E501", # line too long (handled by formatter)
"SIM105", # contextlib.suppress - less readable than try/except/pass
"SIM108", # ternary operator - less readable for multi-line assignments
]

[tool.ruff.format]
quote-style = "double"

[tool.pytest.ini_options]
testpaths = ["tests"]
markers = [
"integration: end-to-end tests requiring a real dashd binary (set DASHD_PATH)",
]