Skip to content

Commit

Permalink
Version 1.0.0
Browse files Browse the repository at this point in the history
  • Loading branch information
gtkacz committed Sep 11, 2024
1 parent f71f11c commit 4b3c4c0
Show file tree
Hide file tree
Showing 6 changed files with 179 additions and 2 deletions.
13 changes: 13 additions & 0 deletions .github/dependabot.yml
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
16 changes: 16 additions & 0 deletions .github/workflows/actionlint.yml
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
12 changes: 12 additions & 0 deletions .github/workflows/python.yml
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
2 changes: 1 addition & 1 deletion LICENSE
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
MIT License

Copyright (c) 2024 Gabriel Tkacz
Copyright (c) 2024 Gabriel Mitelman Tkacz

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
Expand Down
104 changes: 103 additions & 1 deletion README.md
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.
34 changes: 34 additions & 0 deletions action.yml
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'

0 comments on commit 4b3c4c0

Please sign in to comment.