Skip to content

Travis CI: Add a flake8 test for unused imports #994

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

Closed
wants to merge 4 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ before_install: pip install --upgrade pip setuptools
install: pip install -r requirements.txt
before_script:
- black --check . || true
- flake8 . --count --select=E9,F63,F7,F82 --show-source --statistics
- flake8 . --count --select=E9,F401,F63,F7,F82 --show-source --statistics
script:
- mypy --ignore-missing-imports .
#- IGNORE="data_structures,file_transfer_protocol,graphs,machine_learning,maths,neural_network,project_euler"
Expand Down
8 changes: 2 additions & 6 deletions other/primelib.py
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ def isPrime(number):
input: positive integer 'number'
returns true if 'number' is prime otherwise false.
"""
import math # for function sqrt
from math import sqrt

# precondition
assert isinstance(number,int) and (number >= 0) , \
Expand All @@ -56,7 +56,7 @@ def isPrime(number):
if number <= 1:
status = False

for divisor in range(2,int(round(math.sqrt(number)))+1):
for divisor in range(2,int(round(sqrt(number)))+1):

# if 'number' divisible by 'divisor' then sets 'status'
# of false and break up the loop.
Expand Down Expand Up @@ -142,8 +142,6 @@ def primeFactorization(number):
input: positive integer 'number'
returns a list of the prime number factors of 'number'
"""

import math # for function sqrt

# precondition
assert isinstance(number,int) and number >= 0, \
Expand Down Expand Up @@ -496,8 +494,6 @@ def getDivisors(n):

# precondition
assert isinstance(n,int) and (n >= 1), "'n' must been int and >= 1"

from math import sqrt

ans = [] # will be returned.

Expand Down