Skip to content

Commit

Permalink
Allow .fixture.js(x) files to have lines >80 chars.
Browse files Browse the repository at this point in the history
Summary:
These files just hold test data, and it's not useful to make people
wrap the test data which could have really long strings in it.

Test Plan:
In webapp, I temporarily modified
   javascript/content-library-package/components/thumbnail.jsx.fixture.js
to remove the 'max-len' mention in the eslint-disable comment.  I then
ran
   ka-lint javascript/content-library-package/components/thumbnail.jsx.fixture.js
which ran without error.

Reviewers: kevinb, jlfwong

Reviewed By: jlfwong

Differential Revision: https://phabricator.khanacademy.org/D22500
  • Loading branch information
csilvers committed Oct 16, 2015
1 parent b60a05f commit e28945f
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions linters.py
Original file line number Diff line number Diff line change
Expand Up @@ -400,6 +400,11 @@ def _process_one_line(self, filename, output_line, contents_lines):
if '@Nolint' in bad_line:
return 0

# Allow long lines in fixture files, which just hold test data.
if (' Emax-len ' in output_line and
filename.endswith(('.fixture.js', 'fixture.jsx'))):
return 0

print self._maybe_add_arc_fix(output_line, bad_line)
return 1

Expand Down

0 comments on commit e28945f

Please sign in to comment.