-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
6 changed files
with
179 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
# Keep GitHub Actions up to date with GitHub's Dependabot... | ||
# https://docs.github.com/en/code-security/dependabot/working-with-dependabot/keeping-your-actions-up-to-date-with-dependabot | ||
# https://docs.github.com/en/code-security/dependabot/dependabot-version-updates/configuration-options-for-the-dependabot.yml-file#package-ecosystem | ||
version: 2 | ||
updates: | ||
- package-ecosystem: github-actions | ||
directory: / | ||
groups: | ||
github-actions: | ||
patterns: | ||
- "*" # Group all Actions updates into a single larger pull request | ||
schedule: | ||
interval: weekly |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
name: actionlint | ||
|
||
on: | ||
push: | ||
paths: | ||
- '.github/workflows/**' | ||
pull_request: | ||
paths: | ||
- '.github/workflows/**' | ||
|
||
jobs: | ||
actionlint: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v4 | ||
- uses: reviewdog/action-actionlint@v1 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
name: CheckPython | ||
|
||
on: [push, pull_request] | ||
|
||
jobs: | ||
clean-python: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v4 | ||
- uses: psf/black@stable | ||
- uses: chartboost/ruff-action@v1 | ||
- uses: jakebailey/pyright-action@v2 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1,103 @@ | ||
# vulture-action | ||
# Vulture Dead Code Scanner GitHub Action | ||
|
||
This GitHub Action runs [Vulture](https://github.com/jendrikseipp/vulture), a tool for detecting and removing unused Python code, on your repository. It helps you identify and eliminate dead code, improving your project's maintainability and reducing its complexity. | ||
|
||
## Features | ||
|
||
- Easy integration with GitHub workflows | ||
- Flexible configuration using Vulture's CLI arguments | ||
- Supports all Vulture options and features | ||
- Customizable for different project structures and requirements | ||
|
||
## Usage | ||
|
||
To use this action in your workflow, create a `.github/workflows/vulture.yml` file in your repository with the following content: | ||
|
||
```yaml | ||
name: Vulture Dead Code Check | ||
|
||
on: [push, pull_request] | ||
|
||
jobs: | ||
vulture: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v3 | ||
- name: Run Vulture | ||
uses: gtkacz/vulture-action@v1 | ||
with: | ||
args: '. --min-confidence 70 --exclude "tests,docs" --verbose' | ||
``` | ||
## Inputs | ||
This action accepts a single input: | ||
- `args`: Command line arguments to pass to Vulture (required, default: '.') | ||
|
||
You can use any valid Vulture CLI arguments in this input. For a full list of available options, refer to the [Vulture documentation](https://github.com/jendrikseipp/vulture#usage). | ||
|
||
## Examples | ||
|
||
### Basic Usage | ||
|
||
Scan the entire repository with default settings: | ||
|
||
```yaml | ||
- name: Run Vulture | ||
uses: gtkacz/vulture-action@v1 | ||
``` | ||
|
||
### Custom Configuration | ||
|
||
Scan with a minimum confidence of 80%, excluding specific directories, and using verbose output: | ||
|
||
```yaml | ||
- name: Run Vulture | ||
uses: gtkacz/vulture-action@v1 | ||
with: | ||
args: '. --min-confidence 80 --exclude "tests,docs,build" --verbose' | ||
``` | ||
|
||
### Scanning Specific Files or Directories | ||
|
||
Scan only the `src` directory: | ||
|
||
```yaml | ||
- name: Run Vulture | ||
uses: gtkacz/vulture-action@v1 | ||
with: | ||
args: 'src' | ||
``` | ||
|
||
### Using a Configuration File | ||
|
||
If you have a `vulture_config.py` file in your repository: | ||
|
||
```yaml | ||
- name: Run Vulture | ||
uses: gtkacz/vulture-action@v1 | ||
with: | ||
args: '. --make-whitelist vulture_config.py' | ||
``` | ||
|
||
## Customizing the Action | ||
|
||
You can customize the action by modifying the `action.yml` file. The current implementation allows for maximum flexibility, but you might want to add specific inputs or steps based on your project's needs. | ||
|
||
## Contributing | ||
|
||
Contributions to improve this GitHub Action are welcome! Please feel free to submit issues or pull requests. | ||
|
||
## License | ||
|
||
This project is licensed under the MIT License - see the [LICENSE](LICENSE) file for details. | ||
|
||
## Acknowledgements | ||
|
||
- This action uses [Vulture](https://github.com/jendrikseipp/vulture), created by Jendrik Seipp. | ||
- Thanks to the GitHub Actions team for providing the platform and documentation. | ||
|
||
## Support | ||
|
||
If you encounter any problems or have any questions, please open an issue in this repository. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
name: "Vulture GitHub Action" | ||
description: "A GitHub Action of Vulture, a tool for finding dead Python code." | ||
author: "Gabriel Mitelman Tkacz" | ||
inputs: | ||
args: | ||
description: "Arguments passed to Vulture. Use `vulture --help` to see available options." | ||
required: false | ||
src: | ||
description: "Source to run vulture. Default: '.'" | ||
required: false | ||
default: "." | ||
version: | ||
description: 'The version of vulture to use, e.g. "==2.11.0"' | ||
required: false | ||
default: "" | ||
runs: | ||
using: 'composite' | ||
steps: | ||
- name: Set up Python | ||
uses: actions/setup-python@v4 | ||
with: | ||
python-version: '3.11' | ||
|
||
- name: Install Vulture | ||
shell: bash | ||
run: pip install vulture${{ inputs.version }} | ||
|
||
- name: Run Vulture | ||
shell: bash | ||
run: vulture ${{ inputs.src }} ${{ inputs.args }} | ||
|
||
branding: | ||
icon: 'search' | ||
color: 'gray-dark' |