Skip to content

Commit 738d011

Browse files
PEP 8
1 parent 323b294 commit 738d011

4 files changed

Lines changed: 5 additions & 12 deletions

File tree

code_counting/__main__.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,6 @@
1111
from code_counting.lang_controller import LanguagesController
1212
from code_counting.util import explore_folder
1313

14-
1514
logging.getLogger().setLevel(logging.INFO)
1615

1716

@@ -26,7 +25,6 @@ def main(root):
2625
files = explore_folder(root, [])
2726
logging.info('Exploring finished')
2827

29-
3028
logging.info('Checking {} files'.format(len(files)))
3129

3230
for f in files:
@@ -41,7 +39,9 @@ def main(root):
4139
'file'.format(round(time.time() - start, 3), controller.total_lines(), controller.total_files(),
4240
(round(controller.total_lines() / controller.total_files(), 2))))
4341
else:
44-
print('{} seconds to process {} lines of code across {} files.'.format(round(time.time() - start, 3), controller.total_lines(), controller.total_files()))
42+
print('{} seconds to process {} lines of code across {} files.'.format(round(time.time() - start, 3),
43+
controller.total_lines(),
44+
controller.total_files()))
4545

4646

4747
if __name__ == '__main__':

code_counting/lang_controller.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,6 @@ def __init__(self):
1010
self.languages = get_languages()
1111
self.used = {}
1212

13-
1413
def get_used_language(self, lang):
1514
if lang in self.used:
1615
return self.used[lang]

code_counting/util.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ def count_lines_of_code(file):
1414
count = 0
1515

1616
with open(file, encoding='ISO-8859-1') as f:
17-
for line in f:
17+
for _ in f:
1818
count += 1
1919

2020
logging.debug('{} contains {} lines of code'.format(file, count))

tests/each_language_test.py

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
1-
from .constants import *
2-
31
from code_counting.lang_controller import LanguagesController
2+
from .constants import *
43

54

65
def get_line_count(file, language_extension):
@@ -16,25 +15,20 @@ def get_line_count(file, language_extension):
1615

1716

1817
def test_java_line_count():
19-
2018
assert get_line_count(JAVA_FILE, '.java') == JAVA_LINE_COUNT
2119

2220

2321
def test_python_line_count():
24-
2522
assert get_line_count(PYTHON_FILE, '.py') == PYTHON_LINE_COUNT
2623

2724

2825
def test_html_line_count():
29-
3026
assert get_line_count(HTML_FILE, '.html') == HTML_LINE_COUNT
3127

3228

3329
def test_css_line_count():
34-
3530
assert get_line_count(CSS_FILE, '.css') == CSS_LINE_COUNT
3631

3732

3833
def test_javascript_line_count():
39-
4034
assert get_line_count(JAVASCRIPT_FILE, '.js') == JAVASCRIPT_FILE_COUNT

0 commit comments

Comments
 (0)