Skip to content

Commit

Permalink
better readme (#29)
Browse files Browse the repository at this point in the history
  • Loading branch information
haarcuba authored Nov 26, 2024
1 parent 02a97d5 commit bed4cb6
Showing 1 changed file with 13 additions and 8 deletions.
21 changes: 13 additions & 8 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -1091,21 +1091,26 @@ def add_to(element, to=None):

# Enforcing: Pre-Commit hooks <a name="enforcing"></a>

Currently there is support only for the [Import Modules, not Names](#avoid_name_salad) rule using [pre-commit](https://pre-commit.com/).
Currently there are hooks for

* the [Import Modules, not Names](#avoid_name_salad) rule using [pre-commit](https://pre-commit.com/).
* enforce YAML files ending with `.yaml` (and not `.yml`)
* enforce that log messages start with a lowercase letter

Configure like so:

```yaml
- repo: https://github.com/PracticeFoxyCode/practice
rev: releases/0.5.0
rev: releases/1.3.1
hooks:
- id: foxylint-imports
- id: foxylint-imports # import modules, not names
- id: yaml-not-yml # YAML files should end with .yaml
- id: foxylint-loggingcase # log messages should start with a lowercase character
```
You can exclude some files with `--exclude`, e.g.

```yaml
- repo: https://github.com/PracticeFoxyCode/practice
rev: releases/0.5.0
hooks:
- id: foxylint-imports
args:
Expand All @@ -1118,8 +1123,6 @@ You can use `**` globbing in exclude patterns.
You can make overall exceptions with `--accpet`, e.g.

```yaml
- repo: https://github.com/PracticeFoxyCode/practice
rev: releases/0.5.0
hooks:
- id: foxylint-imports
args:
Expand All @@ -1130,7 +1133,7 @@ You can make overall exceptions with `--accpet`, e.g.

There is a default accepted pattern of `from typing import SomeType` to allow for easy use of the `typing` module.

You can also ignore specific lines with the `foxyling-imports:ignore` directive comment, e.g.,
You can also ignore specific lines with the `foxylint-imports:ignore` directive comment, e.g.,

```python
import sys
Expand All @@ -1139,3 +1142,5 @@ from bad import behaviour # foxylint-imports:ignore
def myfunc():
...
```

Similarly, for the `foxylint-loggingcase` hook you can ignore specific lines with `foxylint-loggingcase:ignore`

0 comments on commit bed4cb6

Please sign in to comment.