Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Seeing "files would be reformatted" false positive #11

Open
asaf-kali opened this issue Sep 27, 2020 · 6 comments
Open

Seeing "files would be reformatted" false positive #11

asaf-kali opened this issue Sep 27, 2020 · 6 comments

Comments

@asaf-kali
Copy link

Hi,
Something weird started happening today: the workflow job

  format:
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v2
      - name: Check black formatting
        uses: lgeiger/black-action@master
        with:
          args: '. -l 120 --exclude ".*/node_modules/.*" --check'

is failing over:

would reformat /github/workspace/academic_helper/forms/login_form.py
would reformat /github/workspace/academic_helper/forms/password_reset_form.py
would reformat /github/workspace/academic_helper/forms/signup_form.py
would reformat /github/workspace/academic_helper/logic/schedule.py
would reformat /github/workspace/academic_helper/management/commands/fetch_courses.py
would reformat /github/workspace/academic_helper/management/init_data.py
would reformat /github/workspace/academic_helper/logic/shnaton_parser.py
would reformat /github/workspace/academic_helper/migrations/0002_ratingdummy.py
would reformat /github/workspace/academic_helper/migrations/0001_initial.py
would reformat /github/workspace/academic_helper/migrations/0003_auto_20200527_1531.py
would reformat /github/workspace/academic_helper/migrations/0004_courseclass_courseoccurrence.py
would reformat /github/workspace/academic_helper/migrations/0006_auto_20200531_1534.py
would reformat /github/workspace/academic_helper/migrations/0007_classschedule.py
would reformat /github/workspace/academic_helper/migrations/0008_auto_20200604_0112.py
would reformat /github/workspace/academic_helper/migrations/0005_auto_20200530_2121.py
would reformat /github/workspace/academic_helper/migrations/0009_auto_20200628_0038.py
would reformat /github/workspace/academic_helper/migrations/0011_auto_20200709_1858.py
would reformat /github/workspace/academic_helper/migrations/0012_auto_20200710_1233.py
would reformat /github/workspace/academic_helper/migrations/0013_coursistuser_degree_program.py
would reformat /github/workspace/academic_helper/migrations/0010_auto_20200629_1808.py
would reformat /github/workspace/academic_helper/migrations/0014_auto_20200814_0226.py
would reformat /github/workspace/academic_helper/migrations/0016_auto_20200814_0317.py
would reformat /github/workspace/academic_helper/migrations/0015_auto_20200814_0231.py
would reformat /github/workspace/academic_helper/migrations/0017_auto_20200814_1153.py
would reformat /github/workspace/academic_helper/migrations/0018_coursecomment.py
would reformat /github/workspace/academic_helper/models/course_comment.py
would reformat /github/workspace/academic_helper/models/coursist_user.py
would reformat /github/workspace/academic_helper/tests/test_courses_logic.py
would reformat /github/workspace/academic_helper/urls.py
would reformat /github/workspace/academic_helper/utils/sentry.py
would reformat /github/workspace/academic_helper/views/schedule.py
would reformat /github/workspace/app/settings.py
Oh no! 💥 💔 💥
32 files would be reformatted, 46 files would be left unchanged.

When running black . -l 120 --exclude ".*/node_modules/.*" in the project root dir, I'm getting the expected output:

All done! ✨ 🍰 ✨
78 files left unchanged.
@ToddBradley
Copy link

We noticed the same issue yesterday, where I work.

@Gowee
Copy link

Gowee commented Oct 14, 2020

It seem to be more related to the black project itself?

@Gowee
Copy link

Gowee commented Oct 14, 2020

The behavior sounds similar to psf/black#1140 where the problem is a mismatch of black versions in CI and local environments. If it is, the suggestion for simple fix is to upgrade the version of the locally installed black.

@asaf-kali
Copy link
Author

Sounds like the right way to go.
Currently I can't validate the solution, as now I'm experiencing issue #12 too :)

@rickstaa
Copy link

rickstaa commented Nov 2, 2020

@Gowee This issue is indeed fixed when I update the black version to version 20.8b.

@rickstaa
Copy link

rickstaa commented Nov 2, 2020

Maybe we should put a quick note in the README.md stating that the action uses the latest stable release of black. Alternativelly we can also specify a specific version in the Dockerfile, but I think this is not desired as black should be able to evolve.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants