Vulture is an awesome static code analyzer which helps identify dead code in Python repositories. As a python project maintainer, it is useful to know if a new pull request has introduced any dead code.
The GitHub Actions Hackathon on DEV was an opportunity to experiment with Github Actions and make it easier to find dead code. The Github Actions marketplace didn't have any existing actions for Vulture and so I decided to write one.
Sample run: https://github.com/anaynayak/python-vulture-action/actions/runs/227230739
I have enabled it on one my other repositories BuildNotify and it helped me realise that I had introduced some dead code as well 😄
Here is the link if you'd try it on your repository Python Vulture Action
on: [push] jobs: build: runs-on: ubuntu-latest name: vulture steps: - name: Checkout uses: actions/checkout@v2 - name: Scavenge uses: anaynayak/python-vulture-action@v1 id: vulture with: vulture-args: src --min-confidence 90
Yaml File or Link to Code
anaynayak / python-vulture-action
Run Vulture on your Python codebase to identify dead code.
Python Vulture Action
This action runs Vulture on your Python codebase.
Required Arguments passed to the vulture cli.
on: [push] jobs: build: runs-on: ubuntu-latest name: vulture steps: - name: Checkout uses: actions/checkout@v2 - name: Scavenge uses: anaynayak/python-vulture-action@v1 id: vulture with: vulture-args: example --min-confidence 90
Additional Resources / Info
cover photo by Chris Ried on Unsplash
Top comments (0)