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
16 changes: 3 additions & 13 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -50,19 +50,9 @@ jobs:
- name: Setup Python
uses: actions/setup-python@v4
with:
python-version: "3.13"
- name: Install Python dependencies
run: |
python -m pip install --upgrade hatch
- name: Check with black + isort
if: always()
run: hatch run style:format && git diff --exit-code
- name: Check with ruff
if: always()
run: hatch run style:lint
- name: Check with mypy
if: always()
run: hatch run types:check
python-version: "3.12"
- name: Run pre-commit
uses: pre-commit/action@v3.0.1

package:
runs-on: ubuntu-latest
Expand Down
8 changes: 0 additions & 8 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -21,14 +21,6 @@ repos:
- id: mypy
additional_dependencies:
[types-PyYAML, types-setuptools, typing-extensions, pydantic>=2.5.0]
args:
[
--ignore-missing-imports,
--warn-unreachable,
--no-implicit-optional,
--show-error-codes,
--plugins=pydantic.mypy,
]

- repo: https://github.com/commitizen-tools/commitizen
rev: v3.5.3
Expand Down
18 changes: 6 additions & 12 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -135,23 +135,17 @@ You can now install the project and its dependencies using:
pip install -e .[test]
```

### Code Style and Linting
### Pre-commit hooks

This project uses [ruff](https://docs.astral.sh/ruff/) for both linting and code formatting. Before submitting a pull request, ensure your code follows the project's style guidelines.

To check for linting and formatting issues:
```bash
hatch run style:check
```

To automatically fix linting issues and format your code:
Install [pre-commit](https://pre-commit.com/) hooks to run the same checks as CI before each commit:
```bash
hatch run style:format
pip install pre-commit
pre-commit install
```

To only run linting (with auto-fix):
Run all hooks manually:
```bash
hatch run style:lint
pre-commit run --all-files
```

### Testing
Expand Down
28 changes: 0 additions & 28 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -81,34 +81,6 @@ matrix.type.scripts = [
{ key = "with-coverage", value = "_coverage", if = ["default"] },
]

[tool.hatch.envs.types]
dependencies = [
"mypy",
"types-PyYAML",
"types-setuptools",
"typing-extensions",
]
[tool.hatch.envs.types.scripts]
check = "mypy src/vaultwarden"

[tool.hatch.envs.style]
detached = true
dependencies = [
"ruff",
]
[tool.hatch.envs.style.scripts]
lint = [
"ruff check --fix src/vaultwarden tests",
]
check = [
"ruff check src/vaultwarden tests",
"ruff format --check src/vaultwarden tests",
]
format = [
"ruff format src/vaultwarden tests",
"lint",
]

[tool.ruff]
src = ["src/vaultwarden", "tests"]
exclude = ["src/vaultwarden/utils/crypto.py"]
Expand Down
2 changes: 1 addition & 1 deletion src/vaultwarden/models/bitwarden.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@
Any,
Generic,
Literal,
Self,
TypeVar,
Union,
cast,
Expand All @@ -27,6 +26,7 @@
ValidationInfo,
ValidatorFunctionWrapHandler,
)
from typing_extensions import Self

from vaultwarden.clients.bitwarden import BitwardenAPIClient
from vaultwarden.models.enum import CipherType, KdfType, OrganizationUserType
Expand Down
Loading