Commit 65c2be1b authored by d3k2mk7's avatar d3k2mk7
Browse files

Fixed pycodestyle errors

parent 4bace00d
......@@ -12,8 +12,7 @@ import os
def parse_arguments(args):
import argparse
parser = argparse.ArgumentParser(
description='Plot a column of data read from stdin'
)
description='Plot a column of data read from stdin')
parser.add_argument(
"--header", action='store_true',
......
......@@ -138,8 +138,7 @@ if __name__ == "__main__":
import argparse
parser = argparse.ArgumentParser(
description='rename scottrade statements',
)
description='rename scottrade statements')
parser.add_argument(
"dir", action="store",
help="directory to operate on")
......
[pycodestyle]
max-line-length = 160
# ignore = E501
......@@ -18,7 +18,7 @@ import sys
def compact_print(fname, comment_pattern):
empty_pattern = "^\s*$"
empty_pattern = r"^\s*$"
using_stdin = fname is None
if (using_stdin):
......@@ -48,4 +48,4 @@ if __name__ == "__main__":
help="Input file name. Leave empty for stdin.")
args = parser.parse_args()
compact_print(args.fname, "^\s*#")
compact_print(args.fname, r"^\s*#")
......@@ -17,5 +17,6 @@ to_purchase = 0
print(remaining_balance)
while (remaining_balance > remaining_balance_threshold):
to_purchase += 1
remaining_balance = (initial_balance + to_purchase*(1+bonus)) % ticket_price
print("to_purchase = ", to_purchase, ", remaining_balance = %.2f" % remaining_balance)
remaining_balance = (initial_balance + to_purchase * (1 + bonus)) % ticket_price
print("to_purchase = ", to_purchase,
", remaining_balance = %.2f" % remaining_balance)
......@@ -6,7 +6,8 @@ import os
# python3 -m pytest
# Todo:- Integrate with latest changes in market_data_processor/tests/test_pep8.py
# Todo:- Integrate with latest changes in
# market_data_processor/tests/test_pep8.py
# * ignore E501
# * print statistics at the end
# * if pycodestyle is not there, use pep8
......@@ -14,7 +15,9 @@ import os
def test_codestyle_conformance():
'''Test that all code conforms to pep8 standard'''
codestyle = pycodestyle.StyleGuide(show_source=True)
test_path = os.path.dirname(__file__)
codestyle = pycodestyle.StyleGuide(show_source=True,
config_file=os.path.join(test_path, '../setup.cfg'))
# list of python files
path = '.'
......
......@@ -12,8 +12,7 @@ Sample usage:
def parse_arguments(args):
import argparse
parser = argparse.ArgumentParser(
description='get difference between two timestamps'
)
description='get difference between two timestamps')
parser.add_argument(
"--start", action='store',
default="0:0", dest="start",
......@@ -43,7 +42,7 @@ class HourMinute:
self.mins = float(tokens[1])
def total_minutes(self):
return self.hours*60 + self.mins
return self.hours * 60 + self.mins
def dump(self):
print("hours = ", self.hours)
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment