Thanks to visit codestin.com
Credit goes to github.com

Skip to content

ipynb Files Don't Trigger Python Linting in list_of_files mode #5979

@CraigCallender

Description

@CraigCallender

Describe the bug
We have a CI set up that for PRs, our linters run in list_of_files mode to only detect issues within your PR. But once that PR is merged to main, we run ruff in project mode to ensure we lint everything.

I have a PR that only edited a jupyter notebook (*.ipynb). None of the python linters were activated for that PR and that PR was merged.

Then, when that triggered the CI for the main branch, the ruff linter was activated and detected linting errors in that file.

To Reproduce
Steps to reproduce the behavior:

  1. Setup ruff linting (and other python linters)
  2. Create or edit an ipynb file (and only an ipynb file)
  3. Run megalinter in list_of_files mode with the file from step 2 listed as changed.
  4. See that ruff was not activated.

Expected behavior
The ruff linter (and other python linters that support jupyter notebooks) are/is activated and run against ipynb files.

Screenshots
Here's where the PR is not including *.ipynb files for python linting and thus the linter is not activated:
Image
Image

Here's where we run ruff in project mode and it does lint the *.ipynb files, even though megalinter isn't looking for them:
Image
Image

Additional context
Add any other context about the problem here.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions