Skip to content
Open
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
1 change: 1 addition & 0 deletions .git-blame-ignore-revs
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
c5d1a135763f8c3019d1310444d2596ffa193932 # Ruff auto-formatting
28 changes: 28 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
name: CI for Regzbot

on:
pull_request:

jobs:
ruff:
runs-on: ubuntu-latest

steps:
- name: Check out repository
uses: actions/checkout@v4

- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: "3.10"

- name: Install Ruff
run: |
python -m pip install --upgrade pip
pip install ruff

- name: Check formatting
run: ruff format --check regzbot

- name: Check linting
run: ruff check regzbot --output-format=github
7 changes: 7 additions & 0 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
repos:
- repo: https://github.com/astral-sh/ruff-pre-commit
rev: v0.11.13
hooks:
- id: ruff-format
args: [--check]
- id: ruff-check
40 changes: 40 additions & 0 deletions docs/installation.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,10 @@ Then activate the environment and install the dependencies:
source ~/.local/share/regzbot/python-venv/bin/activate
pip install -r requirements.txt

If you are going to contribute to the project, you should also install the development dependencies:

pip install -r requirements-dev.txt

## setting up git trees

Next create the git trees repositories at `~/.cache/regzbot/gittrees/`. You need git checkouts
Expand Down Expand Up @@ -42,3 +46,39 @@ Now you are ready to run regzbot
./regzbot.sh run

It will generate web reports at `~/.cache/regzbot/websites/`

## Development tools

### Ruff

We use [Ruff](https://github.com/astral-sh/ruff) for fast Python linting and formatting.
The configuration for this tool can be seen in [ruff.toml](../ruff.toml).

#### Running Ruff Checker

You can check the formatting or linting status by running the following commands:

```bash
ruff format --check
ruff check
```

#### Fixing Issues Automatically

You can fix issues automatically with these commands:

```bash
ruff format
ruff check --fix
```

## Pre-commit

To run Ruff automatically on each commit, install the dev dependencies and then install the pre-commit hooks:

pip install -r requirements-dev.txt
pre-commit install

You can also run the hooks on all files manually:

pre-commit run --all-files
Loading