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

Add flake8, autopep8, and pycln to CI #512

Merged
merged 24 commits into from
Oct 13, 2021
Merged

Conversation

Archmonger
Copy link
Contributor

@Archmonger Archmonger commented Oct 12, 2021

This PR adds in PEP8 conformity throughout the repo.

New CI hooks

  • flake8: Provides error messages for PEP8 violations
  • autopep8: Automatically fixes most PEP8 violations
  • pycln: Automatically fixes PEP8 unused imports violations

@codecov
Copy link

codecov bot commented Oct 12, 2021

Codecov Report

Merging #512 (a241f06) into master (8a8ac08) will decrease coverage by 0.01%.
The diff coverage is 72.72%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master     #512      +/-   ##
==========================================
- Coverage   84.61%   84.60%   -0.02%     
==========================================
  Files          51       51              
  Lines        2061     2059       -2     
==========================================
- Hits         1744     1742       -2     
  Misses        317      317              
Impacted Files Coverage Δ
silk/model_factory.py 83.84% <0.00%> (ø)
silk/profiling/dynamic.py 83.47% <ø> (-0.15%) ⬇️
silk/templatetags/silk_inclusion.py 96.55% <ø> (ø)
silk/templatetags/silk_filters.py 66.17% <50.00%> (ø)
silk/sql.py 78.46% <75.00%> (ø)
silk/middleware.py 89.42% <100.00%> (+0.10%) ⬆️
silk/models.py 87.22% <100.00%> (-0.06%) ⬇️
silk/views/cprofile.py 69.23% <100.00%> (-2.20%) ⬇️

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 8a8ac08...a241f06. Read the comment docs.

.pre-commit-config.yaml Outdated Show resolved Hide resolved
@Archmonger
Copy link
Contributor Author

Archmonger commented Oct 12, 2021

Will manually resolve the following tomorrow

silk/models.py:5:1: F401 'collections.Counter' imported but unused
silk/models.py:11:1: F401 'django.db.models.F' imported but unused
project/tests/test_code_gen_curl.py:6:1: F401 'json' imported but unused
project/tests/test_code_gen_curl.py:7:1: F401 'subprocess' imported but unused
project/tests/test_code_gen_curl.py:8:1: F401 'unittest' imported but unused
project/tests/test_code_gen_curl.py:11:1: F401 'silk.code_generation.curl.curl_cmd' imported but unused
project/tests/test_view_profiling.py:1:1: F401 'random' imported but unused
project/tests/test_db.py:20:9: F841 local variable 'objects' is assigned to but never used
project/tests/test_db.py:30:9: F841 local variable 'profile' is assigned to but never used
project/tests/test_db.py:39:9: F841 local variable 'objects' is assigned to but never used
project/tests/test_db.py:55:9: F841 local variable 'profile' is assigned to but never used
project/tests/test_code.py:12:34: E741 ambiguous variable name 'l'
project/tests/test_execute_sql.py:7:1: F401 'silk.sql.connection' imported but unused
silk/views/cprofile.py:6:1: F401 'silk.models.Profile' imported but unused
silk/views/cprofile.py:7:1: F401 'silk.views.code._code_context' imported but unused
silk/views/cprofile.py:7:1: F401 'silk.views.code._code_context_from_request' imported but unused
silk/profiling/dynamic.py:5:1: F401 'functools.partial' imported but unused
project/gen.py:7:5: F841 local variable 'venetian' is assigned to but never used
project/gen.py:8:5: F841 local variable 'roller' is assigned to but never used
silk/templatetags/silk_filters.py:73:12: E741 ambiguous variable name 'l'
project/tests/test_profile_dot.py:55:13: E704 multiple statements on one line (def)
project/tests/test_profile_dot.py:80:36: F841 local variable 'filename' is assigned to but never used
project/tests/test_models.py:92:5: F811 redefinition of unused 'test_time_spent_on_sql_queries_if_has_related_SQLQueries_and_time_taken' from line 84
silk/middleware.py:30:1: E704 multiple statements on one line (def)
project/tests/__init__.py:1:1: F403 'from . import *' used; unable to detect undefined names
project/tests/__init__.py:1:1: F401 'from . import *' imported but unused
silk/model_factory.py:159:13: E722 do not use bare 'except'
project/tests/test_lib/mock_suite.py:1:1: F401 'calendar' imported but unused
project/example_app/tests.py:1:1: F401 'django.test.TestCase' imported but unused
project/tests/test_silky_middleware.py:1:1: F401 'unittest.mock.Mock' imported but unused
project/tests/test_sensitive_data_in_request.py:7:1: F401 'silk.model_factory.ResponseModelFactory' imported but unused

@Archmonger Archmonger changed the title Add flake8 and autopep8 to CI Add flake8, autopep8, and pycln to CI Oct 13, 2021
@Archmonger Archmonger marked this pull request as ready for review October 13, 2021 02:51
@Archmonger Archmonger self-assigned this Oct 13, 2021
@auvipy auvipy merged commit 2245739 into jazzband:master Oct 13, 2021
@Archmonger Archmonger deleted the flake8 branch October 15, 2021 22:45
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