Skip to content

Commit 9ee423c

Browse files
authored
Added some fixes and quality tests (#78)
* updated AUTHORS * fixed documentation * Added tests for presence of tabs
1 parent 23c9e91 commit 9ee423c

File tree

3 files changed

+17
-5
lines changed

3 files changed

+17
-5
lines changed

AUTHORS

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,4 +2,5 @@ Gagandeep Singh<singh.23@iitj.ac.in>
22
Kartikei Mittal<kartikeimittal@gmail.com>
33
Umesh<23umesh.here@gmail.com>
44
Rohan Singh<singh.77@iitj.ac.in>
5-
Tarun Singh Tomar <tomartarun2001@gmail.com>
5+
Tarun Singh Tomar<tomartarun2001@gmail.com>
6+
Saptashrungi Birajdar<saptashrungib@gmail.com>

pydatastructs/miscellaneous_data_structures/stack.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ class Stack(object):
1919
By default, 'array'
2020
Currently only supports 'array'
2121
implementation.
22-
items : DynamicOneDimensionalArray
22+
items : list/tuple
2323
Optional, by default, None
2424
The inital items in the stack.
2525
For array implementation.

pydatastructs/utils/tests/test_code_quality.py

Lines changed: 14 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12,8 +12,9 @@ def _list_files():
1212
py_files.append(os.path.join(dirpath, _file))
1313
return py_files
1414

15+
py_files = _list_files()
16+
1517
def test_trailing_white_spaces():
16-
py_files = _list_files()
1718
for file_path in py_files:
1819
file = open(file_path, "r")
1920
line = file.readline()
@@ -26,7 +27,6 @@ def test_trailing_white_spaces():
2627
file.close()
2728

2829
def test_final_new_lines():
29-
py_files = _list_files()
3030
for file_path in py_files:
3131
file = open(file_path, "r")
3232
lines = []
@@ -42,7 +42,6 @@ def test_final_new_lines():
4242
file.close()
4343

4444
def test_comparison_True_False_None():
45-
py_files = _list_files()
4645
for file_path in py_files:
4746
if file_path.find("test_code_quality.py") == -1:
4847
file = open(file_path, "r")
@@ -59,3 +58,15 @@ def test_comparison_True_False_None():
5958
%(file_path, line)
6059
line = file.readline()
6160
file.close()
61+
62+
def test_presence_of_tabs():
63+
for file_path in py_files:
64+
file = open(file_path, "r")
65+
line = file.readline()
66+
while line != "":
67+
line = file.readline()
68+
if (line.find('\t') != -1):
69+
assert False, "Tab present at %s in %s. " \
70+
"Configure your editor to use " \
71+
"white spaces."
72+
file.close()

0 commit comments

Comments
 (0)