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 flake8 with ruff for linting #259

Merged
merged 6 commits into from
Jan 26, 2025

Conversation

remyroy
Copy link
Member

@remyroy remyroy commented Jan 13, 2025

What I did

Replaced flake8 with ruff for linting. We could eventually use ruff for formatting as well and I'll do some additional tests to see how this can be integrated better.

Related issue

Part of #179

@remyroy remyroy added the run-tests Request tests to run on the CI label Jan 13, 2025
Copy link

Test Coverage: Download HTML Report

Name                                                                 Stmts   Miss  Cover
----------------------------------------------------------------------------------------
ethstaker_deposit/__init__.py                                            1      0   100%
ethstaker_deposit/bls_to_execution_change_keystore.py                   32      2    94%
ethstaker_deposit/cli/__init__.py                                        0      0   100%
ethstaker_deposit/cli/existing_mnemonic.py                              45      0   100%
ethstaker_deposit/cli/exit_transaction_keystore.py                      44      3    93%
ethstaker_deposit/cli/exit_transaction_mnemonic.py                      67      9    87%
ethstaker_deposit/cli/generate_bls_to_execution_change.py               62     11    82%
ethstaker_deposit/cli/generate_bls_to_execution_change_keystore.py      45      3    93%
ethstaker_deposit/cli/generate_keys.py                                  47      2    96%
ethstaker_deposit/cli/new_mnemonic.py                                   33      0   100%
ethstaker_deposit/cli/partial_deposit.py                                68      5    93%
ethstaker_deposit/cli/test_keystore.py                                  23      1    96%
ethstaker_deposit/credentials.py                                       206     76    63%
ethstaker_deposit/deposit.py                                            58     10    83%
ethstaker_deposit/exceptions.py                                          7      0   100%
ethstaker_deposit/key_handling/__init__.py                               0      0   100%
ethstaker_deposit/key_handling/key_derivation/__init__.py                0      0   100%
ethstaker_deposit/key_handling/key_derivation/mnemonic.py               95      6    94%
ethstaker_deposit/key_handling/key_derivation/path.py                   17      1    94%
ethstaker_deposit/key_handling/key_derivation/tree.py                   36      0   100%
ethstaker_deposit/key_handling/keystore.py                              98      0   100%
ethstaker_deposit/settings.py                                           31      0   100%
ethstaker_deposit/utils/__init__.py                                      0      0   100%
ethstaker_deposit/utils/ascii_art.py                                     2      0   100%
ethstaker_deposit/utils/click.py                                        84      3    96%
ethstaker_deposit/utils/config.py                                        3      0   100%
ethstaker_deposit/utils/constants.py                                    29      0   100%
ethstaker_deposit/utils/crypto.py                                       29      1    97%
ethstaker_deposit/utils/deposit.py                                       8      0   100%
ethstaker_deposit/utils/exit_transaction.py                             23      0   100%
ethstaker_deposit/utils/file_handling.py                                13      0   100%
ethstaker_deposit/utils/intl.py                                         55      3    95%
ethstaker_deposit/utils/ssz.py                                          60      7    88%
ethstaker_deposit/utils/terminal.py                                     29     21    28%
ethstaker_deposit/utils/validation.py                                  252     54    79%
----------------------------------------------------------------------------------------
TOTAL                                                                 1602    218    86%

Copy link
Collaborator

@valefar-on-discord valefar-on-discord left a comment

Choose a reason for hiding this comment

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

This breaks the Makefile make venv_lint

Can we do a full replace of flake8 with ruff?

@remyroy
Copy link
Member Author

remyroy commented Jan 19, 2025

Good catch. Let me fix that call or see how it can be fixed.

I believe we can do a full replace of flake8 with ruff since ruff is a superset of flake8.

@remyroy remyroy marked this pull request as draft January 21, 2025 14:37
@remyroy remyroy removed the run-tests Request tests to run on the CI label Jan 21, 2025
Copy link

Test Coverage: Download HTML Report

Name                                                                 Stmts   Miss  Cover
----------------------------------------------------------------------------------------
ethstaker_deposit/__init__.py                                            1      0   100%
ethstaker_deposit/bls_to_execution_change_keystore.py                   32      2    94%
ethstaker_deposit/cli/__init__.py                                        0      0   100%
ethstaker_deposit/cli/existing_mnemonic.py                              45      0   100%
ethstaker_deposit/cli/exit_transaction_keystore.py                      44      3    93%
ethstaker_deposit/cli/exit_transaction_mnemonic.py                      67      9    87%
ethstaker_deposit/cli/generate_bls_to_execution_change.py               62     11    82%
ethstaker_deposit/cli/generate_bls_to_execution_change_keystore.py      45      3    93%
ethstaker_deposit/cli/generate_keys.py                                  47      2    96%
ethstaker_deposit/cli/new_mnemonic.py                                   33      0   100%
ethstaker_deposit/cli/partial_deposit.py                                68      5    93%
ethstaker_deposit/cli/test_keystore.py                                  23      1    96%
ethstaker_deposit/credentials.py                                       206     76    63%
ethstaker_deposit/deposit.py                                            58     10    83%
ethstaker_deposit/exceptions.py                                          7      0   100%
ethstaker_deposit/key_handling/__init__.py                               0      0   100%
ethstaker_deposit/key_handling/key_derivation/__init__.py                0      0   100%
ethstaker_deposit/key_handling/key_derivation/mnemonic.py               95      6    94%
ethstaker_deposit/key_handling/key_derivation/path.py                   17      1    94%
ethstaker_deposit/key_handling/key_derivation/tree.py                   36      0   100%
ethstaker_deposit/key_handling/keystore.py                              98      0   100%
ethstaker_deposit/settings.py                                           31      0   100%
ethstaker_deposit/utils/__init__.py                                      0      0   100%
ethstaker_deposit/utils/ascii_art.py                                     2      0   100%
ethstaker_deposit/utils/click.py                                        84      3    96%
ethstaker_deposit/utils/config.py                                        3      0   100%
ethstaker_deposit/utils/constants.py                                    29      0   100%
ethstaker_deposit/utils/crypto.py                                       29      1    97%
ethstaker_deposit/utils/deposit.py                                       8      0   100%
ethstaker_deposit/utils/exit_transaction.py                             23      0   100%
ethstaker_deposit/utils/file_handling.py                                13      0   100%
ethstaker_deposit/utils/intl.py                                         55      3    95%
ethstaker_deposit/utils/ssz.py                                          60      7    88%
ethstaker_deposit/utils/terminal.py                                     29     21    28%
ethstaker_deposit/utils/validation.py                                  252     54    79%
----------------------------------------------------------------------------------------
TOTAL                                                                 1602    218    86%

@remyroy remyroy marked this pull request as ready for review January 21, 2025 15:39
@remyroy
Copy link
Member Author

remyroy commented Jan 21, 2025

I found a few other things to improve with the replacement of flake8 including the pre-commit tool. This will help for the next step to include ruff automatic formatting. This should be good to check again.

@valefar-on-discord valefar-on-discord merged commit 01cd633 into eth-educators:main Jan 26, 2025
3 checks passed
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.

2 participants