Skip to content

Commit

Permalink
Modified readme, visiumlinted the code
Browse files Browse the repository at this point in the history
  • Loading branch information
Pascal Epple committed Oct 13, 2023
1 parent 00ec6e0 commit bb5e42f
Show file tree
Hide file tree
Showing 2 changed files with 31 additions and 2 deletions.
28 changes: 27 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,33 @@ Visiumlint relies on `black`, `isort`, `pylint`, `pydocstyle` and `mypy`.
- Activate the environment using `pipenv shell`
- Run the visium package by running the command `visiumlint`


# Hook

You can automate visiumlint when commiting changes with a [git hook](https://githooks.com/) and the [pre-commit](https://pre-commit.com/) library.

- Make sure to have installed pre-commit, or else run `brew install pre-commit`

- Add a file called `.pre-commit-config.yaml` to the root of your project:
```yaml
repos:
- repo: https://github.com/VisiumCH/visiumlint
rev: 1.6.0
hooks:
- id: visiumlint
language: python
types: [python]
require_serial: true

- repo: local
hooks:
- id: pylint
name: pylint
entry: pylint
language: python
types: [python]
require_serial: true
```
- Run `pre-commit autoupdate`. This will use the latest available version of visiumlint.
# Development
## Manage your python environment

Expand Down
5 changes: 4 additions & 1 deletion src/visiumlint/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,10 @@
import typer


def lint(check_lint: bool = typer.Option(False, "--check", help="Enable check mode."), hook : bool = typer.Option(False, "--hook", help="Enable hook mode.")) -> None:
def lint(
check_lint: bool = typer.Option(False, "--check", help="Enable check mode."),
hook: bool = typer.Option(False, "--hook", help="Enable hook mode."),
) -> None:
"""Implement the logic of the lint command."""
if check_lint:
check_lint = "--check"
Expand Down

0 comments on commit bb5e42f

Please sign in to comment.