Skip to content

Feature/code style automation #414

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

Closed

Conversation

diptorupd
Copy link
Contributor

Various changes to code style tooling:

  1. flake8, isort jobs added to check for Python code style for new PRs against master, gold/2021, release branches.
  2. black max line width changed to 80 chars.
  3. flake8 and isort configs added.
  4. pre-commit hooks added to make it possible to run all these checks prior to pushing code.
  5. CONTRIBUTION.md updated.

@diptorupd diptorupd force-pushed the feature/code-style-automation branch from c279935 to b0e74b5 Compare April 29, 2021 05:10
@diptorupd diptorupd force-pushed the feature/code-style-automation branch from a844986 to 8e7ab15 Compare April 29, 2021 17:53
@oleksandr-pavlyk
Copy link
Contributor

It is imperative that source code passes all the linter checks before this effort is merged.

My attempt to take this for a ride revealed black auto-formats some code that flake8 flags, example of it being

__all__ = (a
   + b 
   + c
   + d )

Flake8 runs on Cython files, and flags legal Cython extensions of Python as syntactic errors.

@diptorupd
Copy link
Contributor Author

diptorupd commented Apr 30, 2021

It is imperative that source code passes all the linter checks before this effort is merged.

My attempt to take this for a ride revealed black auto-formats some code that flake8 flags, example of it being

__all__ = (a
   + b 
   + c
   + d )

Flake8 runs on Cython files, and flags legal Cython extensions of Python as syntactic errors.

The black docs point out to this possibility and provide a flake config option. I have added the exception to the .flake8 file.

@diptorupd diptorupd force-pushed the feature/code-style-automation branch from 7da077b to dc5a48a Compare April 30, 2021 04:07
@PokhodenkoSA
Copy link
Contributor

@diptorupd I know that muting warnings fixes CI. I would prefer the following way: run checks locally. Find most danger warnings. Fix in separate PRs and the apply this PR.

@PokhodenkoSA
Copy link
Contributor

PokhodenkoSA commented Apr 30, 2021

Fix in separate PRs and the apply this PR.

It will split CI changes from fixes and code improvements.

@diptorupd diptorupd force-pushed the feature/code-style-automation branch 2 times, most recently from 6237235 to 4066b6b Compare April 30, 2021 15:10
@diptorupd
Copy link
Contributor Author

diptorupd commented Apr 30, 2021

It will split CI changes from fixes and code improvements.

Yes, #416 has the fixes. I just rebased #416 on top of this PR to see the results. Ultimately, I will merge #416 separately and this PR will have only the code improvement checks here.

@diptorupd diptorupd force-pushed the feature/code-style-automation branch 6 times, most recently from b85c0a6 to 57802ca Compare April 30, 2021 20:25
@diptorupd diptorupd force-pushed the feature/code-style-automation branch from 57802ca to d3a107f Compare April 30, 2021 20:41
@diptorupd diptorupd closed this Apr 30, 2021
@diptorupd diptorupd deleted the feature/code-style-automation branch May 1, 2021 03:11
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants