Skip to content

Commit

Permalink
docs: upgrade github actions in example
Browse files Browse the repository at this point in the history
  • Loading branch information
AdrianDsg authored and TrueBrain committed Dec 7, 2023
1 parent c832fad commit 7dccc3b
Showing 1 changed file with 27 additions and 28 deletions.
55 changes: 27 additions & 28 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,25 +4,25 @@
[![GitHub Tag](https://img.shields.io/github/v/tag/TrueBrain/actions-flake8?include_prereleases&label=stable)](https://github.com/TrueBrain/actions-flake8/releases)
[![GitHub commits since latest release](https://img.shields.io/github/commits-since/TrueBrain/actions-flake8/latest/main)](https://github.com/TrueBrain/actions-flake8/commits/main)

This GitHub Actions runs flake8 over your code.
This GitHub Actions runs [flake8](https://github.com/PyCQA/flake8) over your code.
Any warnings or errors will be annotated in the Pull Request.

## Usage

```
```yaml
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
- uses: TrueBrain/actions-flake8@v2
```
By default, it uses the default Python version as installed on the GitHub Runner.
### Different Python version
```
```yaml
steps:
- uses: actions/checkout@v3
- uses: actions/setup-python@v3
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
with:
python-version: 3.9
- uses: TrueBrain/actions-flake8@v2
Expand All @@ -36,19 +36,19 @@ In some cases you might want to pin a certain flake8 version.
This parameter is optional; by default the latest flake8 will be installed (if no flake8 is installed yet).
```
```yaml
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
- uses: TrueBrain/actions-flake8@v2
with:
flake8_version: 3.8.0
flake8_version: 6.1.0
```
Alternatively, you can pre-install flake8 before executing this action:
```
```yaml
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
- run: pip install flake8==3.8.0
- uses: TrueBrain/actions-flake8@v2
```
Expand All @@ -62,9 +62,9 @@ This can be useful if your project is more than Python code.

This parameter is optional; by default `flake8` will run on your whole repository.

```
```yaml
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
- uses: TrueBrain/actions-flake8@v2
with:
path: src
Expand All @@ -76,24 +76,23 @@ Indicates errors and warnings to skip.

This parameter is optional; by default no alerts will be ignored

```
```yaml
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
- uses: TrueBrain/actions-flake8@v2
with:
ignore: E4,W
```


### Parameter: max_line_length

Indicates the maximum allowed line length.

This parameter is optional; by default flake8's default line length will be used.

```
```yaml
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
- uses: TrueBrain/actions-flake8@v2
with:
max_line_length: 90
Expand All @@ -107,9 +106,9 @@ All errors and warnings are annotated in Pull Requests, but it will act like eve

This parameter is optional; setting this to any value will enable it.

```
```yaml
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
- uses: TrueBrain/actions-flake8@v2
with:
only_warn: 1
Expand All @@ -121,9 +120,9 @@ List of plugins to install before running, This is passed directly to `pip insta

This parameter is optional; setting this to any value will enable it.

```
```yaml
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
- uses: TrueBrain/actions-flake8@v2
with:
plugins: flake8-bugbear cohesion==0.9.1
Expand All @@ -135,9 +134,9 @@ List of flake8 [error classes](https://flake8.pycqa.org/en/latest/glossary.html#

This parameter is optional; by default `E` and `F` classes will be considered errors.

```
```yaml
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
- uses: TrueBrain/actions-flake8@v2
with:
error_classes: E,H
Expand All @@ -149,9 +148,9 @@ List of flake8 [error classes](https://flake8.pycqa.org/en/latest/glossary.html#

This parameter is optional; by default all classes not contained in `error_classes` will be considered a warning.

```
```yaml
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
- uses: TrueBrain/actions-flake8@v2
with:
warning_classes: W,B,D
Expand All @@ -164,9 +163,9 @@ Useful when you need to give an argument this action otherwise doesn't supply (l

This parameter is optional; by default it is empty.

```
```yaml
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
- uses: TrueBrain/actions-flake8@v2
with:
extra_arguments: "--hang-closing"
Expand Down

0 comments on commit 7dccc3b

Please sign in to comment.