Skip to content

Travis CI: Don’t allow bare exceptions #1734

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

Merged
merged 7 commits into from
Feb 7, 2020
Merged
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 @@ -5,7 +5,7 @@ before_install: pip install --upgrade pip setuptools
install: pip install -r requirements.txt
before_script:
- black --check . || true
- flake8 . --count --select=E101,E9,F4,F63,F7,F82,W191 --show-source --statistics
- flake8 . --count --select=E101,E722,E9,F4,F63,F7,F82,W191 --show-source --statistics
- flake8 . --count --exit-zero --max-line-length=127 --statistics
script:
- scripts/validate_filenames.py # no uppercase, no spaces, in a directory
Expand Down
6 changes: 4 additions & 2 deletions ciphers/transposition_cipher.py
Original file line number Diff line number Diff line change
@@ -1,11 +1,13 @@
import math

'''
"""
In cryptography, the TRANSPOSITION cipher is a method of encryption where the
positions of plaintext are shifted a certain number(determined by the key) that
follows a regular system that results in the permuted text, known as the encrypted
text. The type of transposition cipher demonstrated under is the ROUTE cipher.
'''
"""


def main():
message = input("Enter message: ")
key = int(input("Enter key [2-%s]: " % (len(message) - 1)))
Expand Down
4 changes: 2 additions & 2 deletions ciphers/xor_cipher.py
Original file line number Diff line number Diff line change
Expand Up @@ -148,7 +148,7 @@ def encrypt_file(self, file, key=0):
for line in fin:
fout.write(self.encrypt_string(line, key))

except:
except IOError:
return False

return True
Expand All @@ -173,7 +173,7 @@ def decrypt_file(self, file, key):
for line in fin:
fout.write(self.decrypt_string(line, key))

except:
except IOError:
return False

return True
Expand Down
4 changes: 2 additions & 2 deletions hashes/hamming_code.py
Original file line number Diff line number Diff line change
Expand Up @@ -125,7 +125,7 @@ def emitterConverter(sizePar, data):
if x != None:
try:
aux = (binPos[contLoop])[-1 * (bp)]
except:
except IndexError:
aux = "0"
if aux == "1":
if x == "1":
Expand Down Expand Up @@ -229,7 +229,7 @@ def receptorConverter(sizePar, data):
if x != None:
try:
aux = (binPos[contLoop])[-1 * (bp)]
except:
except IndexError:
aux = "0"
if aux == "1":
if x == "1":
Expand Down
6 changes: 1 addition & 5 deletions linear_algebra/src/test_linear_algebra.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,11 +19,7 @@ def test_component(self):
x = Vector([1, 2, 3])
self.assertEqual(x.component(0), 1)
self.assertEqual(x.component(2), 3)
try:
y = Vector()
self.assertTrue(False)
except:
self.assertTrue(True)
y = Vector()

def test_str(self):
"""
Expand Down