Skip to content

Commit

Permalink
Added some fixes and quality tests (#78)
Browse files Browse the repository at this point in the history
* updated AUTHORS
* fixed documentation
* Added tests for presence of tabs
  • Loading branch information
czgdp1807 authored Jan 1, 2020
1 parent 23c9e91 commit 9ee423c
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 5 deletions.
3 changes: 2 additions & 1 deletion AUTHORS
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,5 @@ Gagandeep Singh<singh.23@iitj.ac.in>
Kartikei Mittal<kartikeimittal@gmail.com>
Umesh<23umesh.here@gmail.com>
Rohan Singh<singh.77@iitj.ac.in>
Tarun Singh Tomar <tomartarun2001@gmail.com>
Tarun Singh Tomar<tomartarun2001@gmail.com>
Saptashrungi Birajdar<saptashrungib@gmail.com>
2 changes: 1 addition & 1 deletion pydatastructs/miscellaneous_data_structures/stack.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ class Stack(object):
By default, 'array'
Currently only supports 'array'
implementation.
items : DynamicOneDimensionalArray
items : list/tuple
Optional, by default, None
The inital items in the stack.
For array implementation.
Expand Down
17 changes: 14 additions & 3 deletions pydatastructs/utils/tests/test_code_quality.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,9 @@ def _list_files():
py_files.append(os.path.join(dirpath, _file))
return py_files

py_files = _list_files()

def test_trailing_white_spaces():
py_files = _list_files()
for file_path in py_files:
file = open(file_path, "r")
line = file.readline()
Expand All @@ -26,7 +27,6 @@ def test_trailing_white_spaces():
file.close()

def test_final_new_lines():
py_files = _list_files()
for file_path in py_files:
file = open(file_path, "r")
lines = []
Expand All @@ -42,7 +42,6 @@ def test_final_new_lines():
file.close()

def test_comparison_True_False_None():
py_files = _list_files()
for file_path in py_files:
if file_path.find("test_code_quality.py") == -1:
file = open(file_path, "r")
Expand All @@ -59,3 +58,15 @@ def test_comparison_True_False_None():
%(file_path, line)
line = file.readline()
file.close()

def test_presence_of_tabs():
for file_path in py_files:
file = open(file_path, "r")
line = file.readline()
while line != "":
line = file.readline()
if (line.find('\t') != -1):
assert False, "Tab present at %s in %s. " \
"Configure your editor to use " \
"white spaces."
file.close()

0 comments on commit 9ee423c

Please sign in to comment.