Skip to content
message-square

GitHub Action

Smelly Python: Smell My PR

v1.0.0 Latest version

Smelly Python: Smell My PR

message-square

Smelly Python: Smell My PR

Post a summary of pylint report as a comment on PRs

Installation

Copy and paste the following snippet into your .yml file.

              

- name: Smelly Python: Smell My PR

uses: smelly-python/smell-my-pr@v1.0.0

Learn more about this action in smelly-python/smell-my-pr

Choose a version

Smelly Python: Smell My PR

An action that runs smelly-python and post summaries of present code smells to jobs and to PRs. Smelly Python runs pylint to check code smells present in your code. This action then posts a job summary in the Actions tab and a comment on your PR (if you pushed to a branch that has an open PR).

smelly-python's PR comment

Workflow setup

Required input:

  • command: command that runs smelly-python on the module you want to analyse. If smelly-python is installed with pipenv, it is pipenv run smelly-python -d <module>.
  • github-token: ${{secrets.GITHUB_TOKEN}}

It is necessary to include the following permissions in your job. See the example of a workflow setup below.

permissions:
  checks: write
  pull-requests: write
  contents: read

Example:

jobs:
  linter:
    [...]
    permissions:
      checks: write
      pull-requests: write
      contents: read
    steps:
    - uses: actions/checkout@v3
    [...]
    - uses: smelly-python/smell-my-pr@main
      with: 
        github-token: ${{secrets.GITHUB_TOKEN}}
        command: pipenv run smelly-python -d src