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
3 changes: 3 additions & 0 deletions .ort.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,9 @@ excludes:
comment: "Packages for testing only."
resolutions:
rule_violations:
- message: ".*PyPI::setuptools:78\\.1\\.1.*"
reason: "CANT_FIX_EXCEPTION"
comment: "BSD 3-Clause New or Revised License: https://github.com/pypa/setuptools/blob/v78.1.1/LICENSE"
- message: ".*PyPI::httpcore:1\\.0\\.9.*"
reason: "CANT_FIX_EXCEPTION"
comment: "BSD 3-Clause New or Revised License: https://github.com/encode/httpcore/blob/1.0.9/LICENSE.md"
Expand Down
16 changes: 16 additions & 0 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
repos:
- repo: local
hooks:
- id: make-format
name: Make Format
pass_filenames: false
entry: make format
language: system
stages: [pre-push]

- id: make-lint
name: Make Lint
pass_filenames: false
entry: make lint
language: system
stages: [pre-push]
4 changes: 4 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,9 @@ clean:
$(POETRY) run clean
$(POETRY) env remove --all

install_git_hooks: install
$(VENV_DIR)/bin/pre-commit install

lint: install
$(POETRY) run nox -s lint

Expand All @@ -44,6 +47,7 @@ help:
@echo '===================='
@echo 'install - install virtual env and dependencies'
@echo 'clean - clean virtual env and build artifacts'
@echo 'install_git_hooks - install the git hooks'
@echo '-- LINTING --'
@echo 'format - run code formatters'
@echo 'lint - run linters'
Expand Down
35 changes: 24 additions & 11 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,7 @@
- [Pre-requisites](#pre-requisites)
- [Setup](#setup)
- [Main commands](#main-commands)
- [Git hooks](#git-hooks)

## Usage

Expand Down Expand Up @@ -789,16 +790,28 @@ The following tools are required to work with the project:
make install
```

### Git hooks

You may optionally install Git hooks that will automatically run the linting step on Git push. You only need to do it once for the given repository.

```sh
make install_git_hooks
```

> [!IMPORTANT]
> This command doesn't work if you have already installed Git hooks locally or globally.

### Main commands

| Command | Description |
|-------------------------|-----------------------------------------------|
| `make install` | Install virtual environment and dependencies |
| `make build` | Build the package |
| `make clean` | Clean virtual environment and build artifacts |
| `make lint` | Run linters |
| `make format` | Run code formatters |
| `make test` | Run tests (e.g., `make test PYTHON=3.12`) |
| `make integration_test` | Run integration tests |
| `make coverage` | Generate test coverage report |
| `make help` | Show available commands |
| Command | Description |
|---------------------------|-----------------------------------------------|
| `make install` | Install virtual environment and dependencies |
| `make build` | Build the package |
| `make clean` | Clean virtual environment and build artifacts |
| `make install_git_hooks` | Install the git hooks |
| `make lint` | Run linters |
| `make format` | Run code formatters |
| `make test` | Run tests (e.g., `make test PYTHON=3.12`) |
| `make integration_test` | Run integration tests |
| `make coverage` | Generate test coverage report |
| `make help` | Show available commands |
Loading
Loading