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

CircleCI: Run some key flake8 tests #64

Merged
merged 4 commits into from
Jul 7, 2019

Conversation

cclauss
Copy link
Contributor

@cclauss cclauss commented Jul 7, 2019

These tests find Python syntax errors and undefined names.
(A second attempt at #63)

@cclauss
Copy link
Contributor Author

cclauss commented Jul 7, 2019

Does not kick off a CircleCI build. :-(

Check the setting at https://circleci.com/gh/my8100/scrapydweb/edit

@my8100
Copy link
Owner

my8100 commented Jul 7, 2019

Does not kick off a CircleCI build. :-(

Check the setting at https://circleci.com/gh/my8100/scrapydweb/edit

I just found that "Build forked pull requests" is off by default.
Sorry for the inconvenience.

@my8100
Copy link
Owner

my8100 commented Jul 7, 2019

Could you push again?

@cclauss
Copy link
Contributor Author

cclauss commented Jul 7, 2019

Yeah!!

@my8100
Copy link
Owner

my8100 commented Jul 7, 2019

You have to pull my previous commit 1ea0ab3 first
in order to get all the tests to pass.

@my8100
Copy link
Owner

my8100 commented Jul 7, 2019

BTW, don't forget to rollback your change in README.md.

@cclauss
Copy link
Contributor Author

cclauss commented Jul 7, 2019

I liked my change to README.md

@coveralls
Copy link

Pull Request Test Coverage Report for Build 37

  • 2 of 4 (50.0%) changed or added relevant lines in 2 files are covered.
  • No unchanged relevant lines lost coverage.
  • Overall coverage increased (+0.2%) to 88.879%

Changes Missing Coverage Covered Lines Changed/Added Lines %
scrapydweb/views/myview.py 1 2 50.0%
scrapydweb/views/operations/deploy.py 1 2 50.0%
Totals Coverage Status
Change from base Build 25: 0.2%
Covered Lines: 3149
Relevant Lines: 3543

💛 - Coveralls

@coveralls
Copy link

coveralls commented Jul 7, 2019

Pull Request Test Coverage Report for Build 36

  • 2 of 4 (50.0%) changed or added relevant lines in 2 files are covered.
  • 2 unchanged lines in 1 file lost coverage.
  • Overall coverage increased (+0.3%) to 88.936%

Changes Missing Coverage Covered Lines Changed/Added Lines %
scrapydweb/views/myview.py 1 2 50.0%
scrapydweb/views/operations/deploy.py 1 2 50.0%
Files with Coverage Reduction New Missed Lines %
scrapydweb/views/overview/jobs.py 2 93.46%
Totals Coverage Status
Change from base Build 25: 0.3%
Covered Lines: 3151
Relevant Lines: 3543

💛 - Coveralls

@my8100 my8100 changed the title CircleCI: Run some key flake8 tests (again) CircleCI: Run some key flake8 tests Jul 7, 2019
@my8100 my8100 merged commit dfcdc07 into my8100:master Jul 7, 2019
@cclauss cclauss deleted the add-flake8-tests branch July 7, 2019 09:49
@my8100
Copy link
Owner

my8100 commented Jul 7, 2019

Details on --select=E9,F63,F7,F82: deeppavlov/DeepPavlov#913 (comment)

flake8 . --count --exclude=./venv* --select=E9,F63,F7,F82 --show-source --statistics

On the flake8 test selection, this PR does not focus on "style violations" (the majority of flake8 error codes that python/black can autocorrect). Instead these tests are focus on runtime safety and correctness:

  • E9 tests are about Python syntax errors usually raised because flake8 can not build an Abstract Syntax Tree (AST). Often these issues are a sign of unused code or code that has not been ported to Python 3. These would be compile-time errors in a compiled language but in a dynamic language like Python they result in the script halting/crashing on the user.
  • F63 tests are usually about the confusion between identity and equality in Python. Use ==/!= to compare str, bytes, and int literals is the classic case. These are areas where a == b is True but a is b is False (or vice versa).
  • F7 tests logic errors and syntax errors in type hints
  • F82 tests are almost always undefined names which are usually a sign of a typo, missing imports, or code that has not been ported to Python 3. These also would be compile-time errors in a compiled language but in Python a NameError is raised which will halt/crash the script on the user.

my8100 added a commit to my8100/logparser that referenced this pull request Jul 7, 2019
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

3 participants