Skip to content

Make the flake8 and black settings consistent#662

Merged
seratch merged 2 commits intoslackapi:mainfrom
seratch:black-flake8-consistency
May 31, 2022
Merged

Make the flake8 and black settings consistent#662
seratch merged 2 commits intoslackapi:mainfrom
seratch:black-flake8-consistency

Conversation

@seratch
Copy link
Copy Markdown
Contributor

@seratch seratch commented May 30, 2022

This pull request changes the black (code formatter) settings to be consistent with flake8. Currently, the max line length is 125 for flake8 validation while we use 88 for auto code formatting by black (= the default setting).

This was due to the lack of consideration when we set up those tools in this project (we borrowed the ones from https://github.com/slackapi/python-slack-sdk, so that I am going to apply the same change to the repo too).

Category (place an x in each of the [ ])

  • slack_bolt.App and/or its core components
  • slack_bolt.async_app.AsyncApp and/or its core components
  • Adapters in slack_bolt.adapter
  • Document pages under /docs
  • Others

Requirements (place an x in each [ ])

Please read the Contributing guidelines and Code of Conduct before creating this issue or pull request. By submitting, you are agreeing to those rules.

  • I've read and understood the Contributing Guidelines and have done my best effort to follow them.
  • I've read and agree to the Code of Conduct.
  • I've run ./scripts/install_all_and_run_tests.sh after making the changes.

@seratch seratch added this to the 1.14.1 milestone May 30, 2022
@seratch seratch self-assigned this May 30, 2022
# black project prefers pyproject.toml
# that's why we have this file in addition to other setting files
[tool.black]
line-length = 125 No newline at end of file
Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is the key change in this PR. With having this file, running black command always respects this configuration

@codecov
Copy link
Copy Markdown

codecov bot commented May 30, 2022

Codecov Report

Merging #662 (0e4cd56) into main (cfc9daa) will not change coverage.
The diff coverage is 88.96%.

❗ Current head 0e4cd56 differs from pull request most recent head 844b38d. Consider uploading reports for the commit 844b38d to get more accurate results

@@           Coverage Diff           @@
##             main     #662   +/-   ##
=======================================
  Coverage   92.05%   92.05%           
=======================================
  Files         172      172           
  Lines        5864     5864           
=======================================
  Hits         5398     5398           
  Misses        466      466           
Impacted Files Coverage Δ
...ck_bolt/adapter/aws_lambda/lazy_listener_runner.py 55.00% <0.00%> (ø)
slack_bolt/app/async_server.py 51.06% <ø> (ø)
slack_bolt/authorization/authorize_result.py 100.00% <ø> (ø)
slack_bolt/context/respond/respond.py 92.59% <0.00%> (ø)
...ck_bolt/workflows/step/utilities/async_complete.py 100.00% <ø> (ø)
slack_bolt/workflows/step/utilities/async_fail.py 100.00% <ø> (ø)
slack_bolt/workflows/step/utilities/complete.py 100.00% <ø> (ø)
slack_bolt/workflows/step/utilities/fail.py 100.00% <ø> (ø)
slack_bolt/context/ack/internals.py 90.62% <33.33%> (ø)
slack_bolt/adapter/falcon/async_resource.py 83.72% <50.00%> (ø)
... and 61 more

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update cfc9daa...844b38d. Read the comment docs.

@eddyg
Copy link
Copy Markdown
Contributor

eddyg commented May 30, 2022

The longer line length will be nice! Will you be adding a .git-blame-ignore-revs file to both repos after this reformatting? (Ref) and also adding it to the .gitconfig with git config blame.ignoreRevsFile .git-blame-ignore-revs? (I don’t know if there are earlier commits that would also make sense to add to the file…)

@seratch
Copy link
Copy Markdown
Contributor Author

seratch commented May 31, 2022

@eddyg Thanks for the great suggestion! I've added the commit. As for the past changes (and future ones), we can add them as necessary.

@seratch seratch merged commit 3457fb1 into slackapi:main May 31, 2022
@seratch seratch deleted the black-flake8-consistency branch May 31, 2022 01:22
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