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

Ruff format #510

Merged
merged 12 commits into from
Mar 14, 2024
Merged

Ruff format #510

merged 12 commits into from
Mar 14, 2024

Conversation

purva-thakre
Copy link
Collaborator

@purva-thakre purva-thakre commented Mar 13, 2024

Description

Ruff workflow job might not be working as intended in

- uses: chartboost/ruff-action@v1

https://github.com/ChartBoost/ruff-action?tab=readme-ov-file#ruff-action

Running ruff format . in toqito altered 114 files in total for the branch in #509 .

Changes

Notable changes that this PR has either accomplished or will accomplish. Feel free to add more lines to the itemized list
below.

  • Change 1

Checklist

Before marking your PR ready for review, make sure you checked the following locally. If this is your first PR, you might be notified of some workflow failures after a maintainer has approved the workflow jobs to be run on your PR.

Additional information is available in the documentation.

  • Use ruff and pylint for errors related to code style and formatting.
  • Verify all previous and newly added unit tests pass in pytest.
  • Check the documentation build does not lead to any failures. Sphinx build can be checked locally for any failures related to your PR
  • Use linkcheck to check for broken links in the documentation
  • Use doctest to verify the examples in the function docstrings work as expected.

dependabot bot and others added 5 commits February 26, 2024 09:54
Updates the requirements on [pylint](https://github.com/pylint-dev/pylint) to permit the latest version.
- [Release notes](https://github.com/pylint-dev/pylint/releases)
- [Commits](pylint-dev/pylint@v3.0.3...v3.1.0)

---
updated-dependencies:
- dependency-name: pylint
  dependency-type: direct:development
...

Signed-off-by: dependabot[bot] <support@github.com>
Copy link

codecov bot commented Mar 13, 2024

Codecov Report

Attention: Patch coverage is 93.90244% with 5 lines in your changes are missing coverage. Please review.

Project coverage is 98.1%. Comparing base (b58f066) to head (c491655).

Files Patch % Lines
toqito/state_props/is_separable.py 25.0% 3 Missing ⚠️
toqito/matrix_props/sk_norm.py 85.7% 1 Missing ⚠️
toqito/nonlocal_games/nonlocal_game.py 85.7% 0 Missing and 1 partial ⚠️
Additional details and impacted files
@@          Coverage Diff           @@
##           master    #510   +/-   ##
======================================
  Coverage    98.1%   98.1%           
======================================
  Files         160     160           
  Lines        3090    3090           
  Branches      751     751           
======================================
  Hits         3032    3032           
  Misses         37      37           
  Partials       21      21           

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

@purva-thakre
Copy link
Collaborator Author

purva-thakre commented Mar 13, 2024

Why does ruff format . change 114 files but ruff check . does not identify any issue with the changes to 114 files?

This failure is in pylint.

************* Module states.w_state
toqito/states/w_state.py:85:0: W1404: Implicit string concatenation found in call (implicit-str-concat)
************* Module state_props.log_negativity
toqito/state_props/log_negativity.py:74:0: W[14](https://github.com/vprusso/toqito/actions/runs/8272457009/job/22634307610?pr=510#step:7:15)04: Implicit string concatenation found in call (implicit-str-concat)
************* Module state_props.negativity
toqito/state_props/negativity.py:75:0: W1404: Implicit string concatenation found in call (implicit-str-concat)
************* Module nonlocal_games.xor_game
toqito/nonlocal_games/xor_game.py:170:0: W1404: Implicit string concatenation found in call (implicit-str-concat)
toqito/nonlocal_games/xor_game.py:173:0: W1404: Implicit string concatenation found in call (implicit-str-concat)
toqito/nonlocal_games/xor_game.py:177:0: W1404: Implicit string concatenation found in call (implicit-str-concat)
************* Module channel_ops.apply_channel
toqito/channel_ops/apply_channel.py:[15](https://github.com/vprusso/toqito/actions/runs/8272457009/job/22634307610?pr=510#step:7:16)0:0: W1404: Implicit string concatenation found in call (implicit-str-concat)
************* Module channel_ops.dual_channel
toqito/channel_ops/dual_channel.py:98:0: W1404: Implicit string concatenation found in call (implicit-str-concat)
************* Module channel_ops.partial_channel
toqito/channel_ops/partial_channel.py:[19](https://github.com/vprusso/toqito/actions/runs/8272457009/job/22634307610?pr=510#step:7:20)5:0: W1404: Implicit string concatenation found in call (implicit-str-concat)
-----------------------------------

https://pylint.readthedocs.io/en/stable/user_guide/messages/warning/implicit-str-concat.html

https://docs.astral.sh/ruff/rules/single-line-implicit-string-concatenation/

A total of 355 files were also again modified when I upgraded to the latest version of ruff in my local virtual environment.

pyproject.toml Outdated Show resolved Hide resolved
@purva-thakre
Copy link
Collaborator Author

Figured out my confusion related to ruff check . and ruff format ..

The former is a linter for Flake8 (plus dozens of plugins), isort, pydocstyle, pyupgrade, autoflake, and more whereas the latter utilizes Black.

https://docs.astral.sh/ruff/formatter/
https://docs.astral.sh/ruff/linter/

The ruff action in the Github actions job only takes care of the linter rules not black.

@vprusso This is ready to be merged. LMK if I forgot to catch something here.

@purva-thakre purva-thakre marked this pull request as ready for review March 14, 2024 16:43
pyproject.toml Outdated Show resolved Hide resolved
@vprusso
Copy link
Owner

vprusso commented Mar 14, 2024

This is great. Awesome to see all of the consistency updates. Went through the diff at a high-level, but everything looked pretty good and sane to me. Nice work, @purva-thakre !

Copy link
Owner

@vprusso vprusso left a comment

Choose a reason for hiding this comment

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

Awesome, looks great! MWR! 🚀

@purva-thakre purva-thakre merged commit f3e2ebd into master Mar 14, 2024
18 checks passed
@purva-thakre purva-thakre deleted the ruff_format branch March 14, 2024 20:26
@purva-thakre purva-thakre added this to the v1.0.8 milestone Mar 28, 2024
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

Successfully merging this pull request may close these issues.

None yet

2 participants