Skip to content

Commit

Permalink
📝 Updates documentation and gitignore
Browse files Browse the repository at this point in the history
  • Loading branch information
rickstaa committed Dec 10, 2020
1 parent c439054 commit a839312
Show file tree
Hide file tree
Showing 3 changed files with 52 additions and 19 deletions.
8 changes: 7 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,2 +1,8 @@
node_modules
# files to ignore
package.json
package-lock.json
*.code-workspace

# Folders to ignore
.vscode
node_modules
56 changes: 41 additions & 15 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,12 +1,13 @@
# py-actions/flake8 GitHub Action

![Version](https://img.shields.io/github/v/release/py-actions/flake8?sort=semver)
[![LICENSE](https://img.shields.io/badge/LICENSE-apache2-success)](https://github.com/rickstaa/action-flake8/blob/master/LICENSE)
[![Linux CI](https://github.com/py-actions/flake8/workflows/Linux%20CI/badge.svg)](https://github.com/py-actions/flake8/actions?query=workflow%3A%22Linux+CI%22)
[![macOS CI](https://github.com/py-actions/flake8/workflows/macOS%20CI/badge.svg)](https://github.com/py-actions/flake8/actions?query=workflow%3A%22macOS+CI%22)
[![Windows CI](https://github.com/py-actions/flake8/workflows/Windows%20CI/badge.svg)](https://github.com/py-actions/flake8/actions?query=workflow%3A%22Windows+CI%22)
[![Lint](https://github.com/py-actions/flake8/workflows/Lint/badge.svg)](https://github.com/py-actions/flake8/actions?query=workflow%3ALint)

This GitHub Action installs the Python [flake8 package](https://pypi.org/project/flake8/) in an environment with a Python interpreter and executes flake8 stylistic and logical linting of Python source files. flake8 installation and execution defaults can be configured with optional Action settings.
This action runs flak8 with [reviewdog](https://github.com/reviewdog/reviewdog) on pull requests to lint to lint python source files while creating annotations. It does this by installing the Python [flake8 package](https://pypi.org/project/flake8/) in an environment with a Python interpreter and executes flake8 stylistic and logical linting of Python source files. Following [reviewdog](https://github.com/reviewdog/reviewdog) is used to parse the bash output into github annotations. Flake8 and reviewdog installation and execution defaults can be configured with optional Action settings.

## Quick Start

Expand All @@ -29,7 +30,9 @@ jobs:
with:
python-version: "3.8"
- name: flake8 Lint
uses: py-actions/flake8@v1
uses: rickstaa/flake8@v2
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
```
### With non-default settings
Expand All @@ -51,8 +54,11 @@ jobs:
with:
python-version: "3.8"
- name: flake8 Lint
uses: py-actions/flake8@v1
uses: py-actions/flake8@v2
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
reporter: github-pr-check # Change reporter. (Only `github-pr-check` is supported at the moment).
level: warning
ignore: "F401"
exclude: "src/ignoreme.py"
max-line-length: "100"
Expand All @@ -63,44 +69,64 @@ See the Inputs section below for details on the defaults and optional configurat
## Inputs
Configure the Action with the following *optional* settings:
Configure the Action with the following _optional_ settings:
### Flake8 options
### `flake8-version`
#### `flake8-version`

**Optional** flake8 version for testing. Options: ['latest', 'master', '[VERSION NUMBER]'].Default = `"latest"`.
**Optional** flake8 version for testing. Options: \['latest', 'master', '[VERSION NUMBER]'].Default = `"latest"`.

- 'latest' = current PyPI release version
- 'master' = current [GitLab source repository master branch version](https://gitlab.com/pycqa/flake8)
- '[VERSION NUMBER]' = the version number of the [flake8 PyPI package](https://pypi.org/project/flake8/) (e.g., `"3.7.9"`)
- 'latest' = current PyPI release version
- 'master' = current [GitLab source repository master branch version](https://gitlab.com/pycqa/flake8)
- '[VERSION NUMBER]' = the version number of the [flake8 PyPI package](https://pypi.org/project/flake8/) (e.g., `"3.7.9"`)

### `path`
#### `path`

**Optional** The path to the Python source file(s) or directory. Default = `"."`.

### `args`
#### `args`

**Optional** Command line arguments to the flake8 executable. Default = None.

Please note that some command line arguments can be defined with other fields in your configuration. You may combine the `args` setting with the other settings below, or use `args` to configure flake8 without the other Action settings.

See the inputs below for additional details.

### `exclude`
#### `exclude`

**Optional** Comma-delimited list of ignored file paths. Default = flake8 default.

### `ignore`
#### `ignore`

**Optional** Comma-delimited list of ignored flake8 rule codes. Default = flake8 default.

### `max-line-length`
#### `max-line-length`

**Optional** Integer value (as string) representing maximum acceptable line length. Default = flake8 default.

### `update-pip`
#### `update-pip`

**Optional** Update `pip` before the flake8 install. Options: [`"true"`, `"false"`]. Default = `"false"`.

### Reviewdog options

#### `github_token`

**Required** Your github action token.

#### `level`

**Optional** The log level of the reviewdog reporter. Options: [`"info"`, `"warning"`, `"error"`]. Default = `"error"`.

#### `level`

**Optional** The log level of the reviewdog reporter. Options: [`"info"`, `"warning"`, `"error"`]. Default = `"error"`.

#### `reporter`

**Optional** The reviewdog reporter type. Only `github-pr-check` is supported at the moment. Default = `"github-pr-check"`.

## Outputs

None
Expand Down
7 changes: 4 additions & 3 deletions action.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@

name: "Python flake8 Lint"
description: "Logical and stylistic linting of Python source files with the flake8 package"
name: "Run flake8 with reviewdog"
description: "🐶 Run flak8 with reviewdog on pull requests to lint python source files while creating annotations."
author: Rick Staa
inputs:
path: # id
description: "Path to source file or directory (default='.')"
Expand Down Expand Up @@ -50,5 +51,5 @@ runs:
main: "dist/index.js"

branding:
icon: "terminal"
icon: "check"
color: "blue"

0 comments on commit a839312

Please sign in to comment.