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

Replace black with ruff in pre-commit config #2394

Merged
merged 8 commits into from Oct 25, 2023

Conversation

0scvr
Copy link
Contributor

@0scvr 0scvr commented Oct 25, 2023

Description

Replaced black with ruff in pre-commit config

Motivation and context

Related issues

Fixes #2393

Fixes PlasmaPy#2393

Signed-off-by: Oscar <71343264+0scvr@users.noreply.github.com>
@github-actions github-actions bot added CI Related to continuous integration linters For linters (e.g., flake8, ruff) and autoformatters (e.g., ruff, black, isort, Sourcery) labels Oct 25, 2023
@github-actions
Copy link

Thank you for submitting a pull request (PR) to PlasmaPy! ✨ The future of the project depends on contributors like you, so we deeply appreciate it! 🌱

Our contributor guide has information on:

The bottom of this page shows several checks that are run for every PR. Don't worry if something broke! We break stuff all the time. 😺 Click on "Details" to learn why a check didn't pass. Please also feel free to ask for help. We do that all the time as well. 🌸 You can find us in our chat room or weekly community meeting & office hours. Here are some tips:

  • Try fixing CI / Python 3.11 test failures first.
  • Most pre-commit.ci - pr failures can be automagically fixed by commenting pre-commit.ci autofix below, followed by a git pull to bring the changes back to your computer.
  • If pre-commit.ci - pr says that a function is too long or complex, try breaking up that function into multiple short functions that each do one thing. See also these tips on writing clean scientific software.
  • If the CI / Documentation check ends with a cryptic error message, check out our documentation troubleshooting guide.
  • For a documentation preview, click on Details next to docs/readthedocs.org:plasmapy.

If this PR is marked as ready for review, someone should stop by to provide a code review and offer suggestions soon. ✅ If you don't get a review within a few days, please feel free to send us a reminder.

Please also use SI units within PlasmaPy, except when there is strong justification otherwise or in some examples.

We thank you once again!

@codecov
Copy link

codecov bot commented Oct 25, 2023

Codecov Report

All modified and coverable lines are covered by tests ✅

Comparison is base (1df1ed8) 96.91% compared to head (c5b81f5) 96.91%.

❗ Current head c5b81f5 differs from pull request most recent head 00e83e3. Consider uploading reports for the commit 00e83e3 to get more accurate results

Additional details and impacted files
@@           Coverage Diff           @@
##             main    #2394   +/-   ##
=======================================
  Coverage   96.91%   96.91%           
=======================================
  Files         104      104           
  Lines        9118     9118           
=======================================
  Hits         8837     8837           
  Misses        281      281           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

Signed-off-by: Oscar <71343264+0scvr@users.noreply.github.com>
@github-actions github-actions bot added the packaging Related to packaging or distribution label Oct 25, 2023
Signed-off-by: Oscar <71343264+0scvr@users.noreply.github.com>
@0scvr
Copy link
Contributor Author

0scvr commented Oct 25, 2023

pre-commit.ci autofix

@0scvr 0scvr marked this pull request as ready for review October 25, 2023 13:24
@0scvr 0scvr requested review from namurphy and a team as code owners October 25, 2023 13:24
@0scvr
Copy link
Contributor Author

0scvr commented Oct 25, 2023

I'm not sure why the docs fail to build. Should be working fine.

/home/runner/work/PlasmaPy/PlasmaPy/.tox/build_docs_pins/lib/python3.11/site-packages/nbsphinx/__init__.py:1058: RuntimeWarning: You are using an unsupported version of pandoc (2.9.2.1).
Your version must be at least (2.14.2) but less than (4.0.0).
Refer to https://pandoc.org/installing.html.
Continuing with doubts...
  nbconvert.utils.pandoc.check_pandoc_version()
<unknown>:16: WARNING: py:obj reference target not found: black
<unknown>:16: WARNING: py:obj reference target not found: ruff
Loading template...
Finding news fragments...
build_docs_pins: exit 1 (313.83 seconds) /home/runner/work/PlasmaPy/PlasmaPy> sphinx-build docs docs/_build/html -W -n --keep-going -b html -q pid=2374
.pkg: _exit> python /opt/hostedtoolcache/Python/3.11.6/x64/lib/python3.11/site-packages/pyproject_api/_backend.py True setuptools.build_meta
  build_docs_pins: FAIL code 1 (411.19=setup[97.36]+cmd[313.83] seconds)
  evaluation failed :( (411.29 seconds)
Error: Process completed with exit code 1.

Copy link
Member

@namurphy namurphy left a comment

Choose a reason for hiding this comment

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

Thank you for doing this! The doc build error is happening because we haven't connected our doc build to the docs for ruff or black, but I think my suggestion should be able to fix it. Thank you again for addressing this so quickly!

Co-authored-by: Nick Murphy <namurphy@cfa.harvard.edu>
@namurphy namurphy enabled auto-merge (squash) October 25, 2023 14:25
@namurphy
Copy link
Member

pre-commit.ci autofix

@github-actions github-actions bot added plasmapy.plasma Related to the plasmapy.plasma subpackage plasmapy.formulary Related to the plasmapy.formulary subpackage testing labels Oct 25, 2023
@github-actions github-actions bot added plasmapy.diagnostics Related to the plasmapy.diagnostics subpackage plasmapy.utils Related to the plasmapy.utils subpackage plasmapy.dispersion Related to the plasmapy.dispersion subpackage labels Oct 25, 2023
@namurphy namurphy enabled auto-merge (squash) October 25, 2023 15:32
@namurphy namurphy merged commit d13e52b into PlasmaPy:main Oct 25, 2023
13 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
CI Related to continuous integration linters For linters (e.g., flake8, ruff) and autoformatters (e.g., ruff, black, isort, Sourcery) packaging Related to packaging or distribution plasmapy.diagnostics Related to the plasmapy.diagnostics subpackage plasmapy.dispersion Related to the plasmapy.dispersion subpackage plasmapy.formulary Related to the plasmapy.formulary subpackage plasmapy.plasma Related to the plasmapy.plasma subpackage plasmapy.utils Related to the plasmapy.utils subpackage testing
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Switch from black to the ruff formatter
2 participants