Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/creyd/autopep8_action
Automatically runs the autopep8 command against any commit/ pull request created.
https://github.com/creyd/autopep8_action
automation autopep8 github-action pep8 python3
Last synced: about 2 months ago
JSON representation
Automatically runs the autopep8 command against any commit/ pull request created.
- Host: GitHub
- URL: https://github.com/creyd/autopep8_action
- Owner: creyD
- License: mit
- Created: 2019-11-14T22:52:59.000Z (about 5 years ago)
- Default Branch: master
- Last Pushed: 2023-05-24T09:24:51.000Z (over 1 year ago)
- Last Synced: 2024-03-15T11:04:19.699Z (10 months ago)
- Topics: automation, autopep8, github-action, pep8, python3
- Language: Shell
- Homepage:
- Size: 21.5 KB
- Stars: 2
- Watchers: 2
- Forks: 3
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# GitHub autopep8 Action
[![License MIT](https://img.shields.io/github/license/creyD/autopep8_action)](https://github.com/creyD/autopep8_action/blob/master/LICENSE)
[![Latest Release](https://img.shields.io/github/v/release/creyD/autopep8_action)](https://github.com/creyD/autopep8_action/releases)
[![Contributors](https://img.shields.io/github/contributors-anon/creyD/autopep8_action)](https://github.com/creyD/autopep8_action/graphs/contributors)
[![Issues](https://img.shields.io/github/issues/creyD/autopep8_action)](https://github.com/creyD/autopep8_action/issues)This action automatically restyles Python code according to [PEP-8](https://www.python.org/dev/peps/pep-0008/) using [autopep8](https://github.com/hhatto/autopep8).
## Usage
### ParametersThe following parameters can be used in your custom action configuration.
| Parameter | Required | Default | Description |
| - | - | - | - |
| commit_message | :x: | 'Adjusted files for PEP-8 compliance' | Custom git commit message |
| commit_options | :x: | - | Custom git commit options |
| file_pattern | :x: | '*' | Custom file pattern for `git add` |
| checkpath | :x: | '.' | The path autopep8 checks |
| no_commit | :x: | False | Avoid committing, if used in a pipeline |
| options | :x: | ' ' | Parameters to use with autopep8 |
| dry | :x: | false | Dry-run the action to fail when detecting PEP-8 uncompliant files, instead of automatically fixing them. |
| github_token | :x: | `${{ github.token }}` | The default [GITHUB_TOKEN](https://docs.github.com/en/actions/reference/authentication-in-a-workflow#about-the-github_token-secret) or a [Personal Access Token](https://docs.github.com/en/github/authenticating-to-github/keeping-your-account-and-data-secure/creating-a-personal-access-token)> Note: using the same_commit option may lead to problems if other actions are relying on the commit being the same before and after the prettier action has ran. Keep this in mind.
### Example
This is a simple usage example of this script:
```yaml
# This action works with pull requests and pushes
name: Continuous Integrationon:
pull_request:
push:
branches:
- masterjobs:
build:
runs-on: ubuntu-lateststeps:
- uses: actions/checkout@v3
with:
# Make sure the actual branch is checked out when running on pull requests
ref: ${{ github.head_ref }}
- uses: creyD/[email protected]
```More documentation for writing a workflow can be found [here](https://help.github.com/en/actions/automating-your-workflow-with-github-actions/workflow-syntax-for-github-actions).
## Issues
Please report all bugs and feature request using the [GitHub issues function](https://github.com/creyD/autopep8_action/issues/new).
## Special Thanks
- Hideo Hattori [(GitHub)](https://github.com/hhatto) for creating and maintaining autopep8
- Stefan Zweifel [(GitHub)](https://github.com/stefanzweifel) for providing an action to commit and push a git changeIf you want you may also use my [autoflake](https://github.com/creyD/autoflake_action) and [prettier](https://github.com/creyD/prettier_action) GitHub actions.