Skip to content

Commit

Permalink
Removing the timeout multiplier, to get in sync with linting files. (o…
Browse files Browse the repository at this point in the history
…ppia#6559)

* First

* First

* Second

* Third

* Fourth

* Reset

* Removed timeout multiplier

* Fixed linting

* Fixed linting

* Fixed

* Removed the comment

* Removed the comment

* Added PyGithub path
  • Loading branch information
anubhavsinha98 authored and apb7 committed Apr 15, 2019
1 parent e7d1de4 commit d88e72a
Showing 1 changed file with 3 additions and 18 deletions.
21 changes: 3 additions & 18 deletions scripts/pre_commit_linter.py
Original file line number Diff line number Diff line change
Expand Up @@ -302,6 +302,7 @@
os.path.join(_PARENT_DIR, 'oppia_tools', 'pylint-quotes-0.1.9'),
os.path.join(_PARENT_DIR, 'oppia_tools', 'selenium-2.53.2'),
os.path.join(_PARENT_DIR, 'oppia_tools', 'PIL-1.1.7'),
os.path.join(_PARENT_DIR, 'oppia_tools', 'PyGithub-1.43.5'),
os.path.join('third_party', 'backports.functools_lru_cache-1.5'),
os.path.join('third_party', 'gae-pipeline-1.9.17.0'),
os.path.join('third_party', 'bleach-1.2.2'),
Expand Down Expand Up @@ -1075,24 +1076,8 @@ def _lint_all_files(self):
process.daemon = False
process.start()

file_groups_to_lint = [
html_files_to_lint_for_css, css_files_to_lint,
js_files_to_lint, py_files_to_lint]
number_of_files_to_lint = sum(
len(file_group) for file_group in file_groups_to_lint)

timeout_multiplier = 2000
for file_group, process in zip(file_groups_to_lint, linting_processes):
# try..except block is needed to catch ZeroDivisionError
# when there are no CSS, HTML, JavaScript and Python files to lint.
try:
# Require timeout parameter to prevent against endless
# waiting for the linting function to return.
process.join(timeout=(
timeout_multiplier * (
len(file_group) / number_of_files_to_lint)))
except ZeroDivisionError:
break
for process in linting_processes:
process.join()

js_messages = []
while not js_stdout.empty():
Expand Down

0 comments on commit d88e72a

Please sign in to comment.