ricardochaves / python-lint

GitHub Action for Lint your code
MIT License
91 stars 41 forks source link

Latest version of black? #12

Open turian opened 3 years ago

turian commented 3 years ago

What version of black does this use? Is it the latest?

On github with this docker I get

Running: black --check src
would reformat /github/workspace/src/ddspdrum/module.py
Oh no! 💥 💔 💥

On my laptop I have the latest pypi black and get

All done! ✨ 🍰 ✨
5 files would be left unchanged.
ricardochaves commented 3 years ago

The black version is 19.10b0

What version of action are you using? Depending on the version you use, you may be experiencing this problem. At first it was solved in Isort 5. What version of Isort are you using?

Can you send me your yml?

turian commented 3 years ago

https://github.com/turian/ddsp-drum/blob/main/.github/workflows/pylint.yml

Thank you

alvarovn commented 3 years ago

We are having the same issue with black, not using isort. This is our yml:

name: Lint

on:
  pull_request:
    types: ["opened", "edited", "reopened", "synchronize"]

jobs:
  lint:
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@master
      - name: python-lint
        uses: ricardochaves/python-lint@v1.1.0
        with:
          use-pylint: false
          use-pycodestyle: false
          use-flake8: true
          use-black: true
          use-mypy: false
          use-isort: false
          extra-flake8-options: "--max-line-length=99"
          extra-black-options: "--line-length=99"
ricardochaves commented 3 years ago

Hi @alvarovn , how are u? Can you try the version python-lint@v1.3.0, pls?

alvarovn commented 3 years ago

I just tried and have the same issue. Fedora 33 black version is 20.8b1, which has different results from 19.10b0 Since black results are inconsistent between versions, it would be helpful to be able to choose the version.

ricardochaves commented 3 years ago

I put an image with new versions of the libs. I also added how we can test the action locally in README.md. Could you try and post the results here, please?

turian commented 3 years ago

@ricardochaves I haven't been able to replicate the bug, I'll let you know if I do.

BTW, you should consider bumping the version of black again. There are more fixes in the latest: https://github.com/psf/black/issues/2199

dexter2206 commented 3 years ago

Are there any plans for the next bump of black version? The version used by this action does not support Python 3.9, i.e. the action fails with a matrix containing Python 3.9 because switch -t py39 is invalid. Black 21.7b0 seems to include py39 as an available option.