Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

better readme #29

Merged
merged 1 commit into from
Nov 26, 2024
Merged
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
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`