Skip to content

Commit

Permalink
Revert "add a lint to warn on implicit string concatenation (pantsbui…
Browse files Browse the repository at this point in the history
…ld#7286)" (pantsbuild#7340)

This reverts commit 3a81e86.

### Problem

The use of the `asttokens` library, now within the pythonstyle checker pex, is causing a variant of pantsbuild#7158 when consumed outside of this repo. Additionally, some files fail to parse with:
```
    for tok in tokenize.generate_tokens(StringIO(str_node_text).readline):
  File "/opt/ee/python/2.7/lib/python2.7/tokenize.py", line 374, in generate_tokens
    ("<tokenize>", lnum, pos, line))
  File "<tokenize>", line 3
    "else echo 'no_op'; fi)"
```

Suppressing the lint only works if the lint runs without error, so this makes it impossible to consume outside of the pants repo right now (or at least, impossible in a lot of repos outside of the pants repo).

### Solution

- Revert pantsbuild#7286.

### Result

This will be unreverted asap when the above issues are investigated and fixed.
  • Loading branch information
cosmicexplorer authored Mar 8, 2019
1 parent 646699b commit e65723a
Show file tree
Hide file tree
Showing 7 changed files with 0 additions and 94 deletions.
1 change: 0 additions & 1 deletion build-support/checkstyle/python_suppressions.txt

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@ python_library(
}
),
dependencies=[
'3rdparty/python:asttokens',
'3rdparty/python:future',
'3rdparty/python:pycodestyle',
'3rdparty/python:pyflakes',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,6 @@
from pants.contrib.python.checks.checker.except_statements import ExceptStatements
from pants.contrib.python.checks.checker.file_excluder import FileExcluder
from pants.contrib.python.checks.checker.future_compatibility import FutureCompatibility
from pants.contrib.python.checks.checker.implicit_string_concatenation import \
ImplicitStringConcatenation
from pants.contrib.python.checks.checker.import_order import ImportOrder
from pants.contrib.python.checks.checker.indentation import Indentation
from pants.contrib.python.checks.checker.missing_contextmanager import MissingContextManager
Expand Down Expand Up @@ -134,7 +132,6 @@ def plugins():
ConstantLogic,
ExceptStatements,
FutureCompatibility,
ImplicitStringConcatenation,
ImportOrder,
Indentation,
MissingContextManager,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@
import textwrap
import tokenize

import asttokens
import six


Expand Down Expand Up @@ -106,7 +105,6 @@ def _remove_coding_header(cls, blob):
def __init__(self, blob, tree, root, filename):
self._blob = self._remove_coding_header(blob)
self.tree = tree
self.tokenized_file_body = asttokens.ASTTokens(self._blob, tree=self.tree, filename=filename)
self.lines = OffByOneList(self._blob.decode('utf-8').split('\n'))
self._root = root
self.filename = filename
Expand Down

This file was deleted.

This file was deleted.

3 changes: 0 additions & 3 deletions pants.ini
Original file line number Diff line number Diff line change
Expand Up @@ -242,9 +242,6 @@ configuration: %(pants_supportdir)s/checkstyle/coding_style.xml
[lint.google-java-format]
skip: True

[lint.pythonstyle]
suppress: %(pants_supportdir)s/checkstyle/python_suppressions.txt

[lint.python-eval]
# After we fix the cycles from the engine refactor we should re-enable this.
# https://github.com/pantsbuild/pants/issues/4601
Expand Down

0 comments on commit e65723a

Please sign in to comment.