2023-05-23 13:09:17 +02:00
2023-05-23 12:46:15 +02:00
2023-05-23 13:07:21 +02:00
2023-05-23 13:09:17 +02:00
2023-05-23 11:36:22 +02:00
2023-05-23 13:04:15 +02:00

GitHub autoflake Action

This GitHub action automatically removes unused imports and variables from your Python code using autoflake.

Usage

Parameters

The following parameters can be used in your custom action configuration.

Parameter Required Default Description
commit_message 'Removed unused imports and variables' Custom git commit message
commit_options - Custom git commit options
file_pattern '*' Custom file pattern for git add
checkpath '.' The path autoflake checks
no_commit False Avoid committing, if used in a pipeline
options ' ' Parameters to use with autoflake
dry false Dry-run the action to fail when detecting uncompliant files, instead of automatically fixing them.

Example

This is a simple usage example of this script:

# This action works with pull requests and pushes
name: Continuous Integration

on:
  pull_request:
  push:
    branches:
    - master

jobs:
  format:
    runs-on: ubuntu-latest

    steps:
    - uses: actions/checkout@v3
    - uses: creyD/autoflake_action@master
      env:
        GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

Issues

Please report all bugs and feature request using the GitHub issues function.

Description
Automatically runs the autoflake command against any commit/ pull request created
Readme MIT 75 KiB
Languages
Shell 87.5%
Dockerfile 12.5%