Skip to content

Commit 2ecd1b7

Browse files
bollwyvlkrassowski
authored andcommitted
linting
1 parent bb19f8c commit 2ecd1b7

File tree

3 files changed

+13
-9
lines changed

3 files changed

+13
-9
lines changed

atest/logcheck.py

Lines changed: 11 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
1-
import os
2-
31
from bs4 import UnicodeDammit
42

53

@@ -13,12 +11,18 @@ def file_should_not_contain_phrases(filename, offset=0, *phrases):
1311
try:
1412
text = raw.decode("utf-8")
1513
except Exception as err:
16-
text = UnicodeDammit.detwingle(raw).decode("utf-8")
14+
print("Failed to read", filename, "forcing unicode...\n", err)
15+
try:
16+
text = UnicodeDammit.detwingle(raw).decode("utf-8")
17+
except Exception as err:
18+
print("Failed to read", filename, "giving up...\n", err)
19+
text = None
1720

1821
matches = {}
1922

20-
for phrase in phrases:
21-
if phrase in text:
22-
matches[phrase] = True
23+
if text is not None:
24+
for phrase in phrases:
25+
if phrase in text:
26+
matches[phrase] = True
2327

24-
assert not matches, "Phrases found in {}: {}".format(filename, matches)
28+
assert not matches, "Phrases found in {}: {}".format(filename, matches)

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@
5151
"lint:check": "jlpm prettier:check && jlpm eslint:check",
5252
"lint": "jlpm prettier && jlpm eslint",
5353
"prettier:check": "prettier --check \"**/*{.ts,.tsx,.js,.jsx,.css,.json,.md,.yml}\"",
54-
"prettier": "prettier --write \"**/*{.ts,.tsx,.js,.jsx,.css,.json,.md,.yml}\"",
54+
"prettier": "prettier --list-different --write \"**/*{.ts,.tsx,.js,.jsx,.css,.json,.md,.yml}\"",
5555
"eslint": "eslint --config packages/.eslintrc.js --ext .js,.jsx,.ts,.tsx --fix packages",
5656
"eslint:check": "eslint --config packages/.eslintrc.js --ext .js,.jsx,.ts,.tsx packages",
5757
"test": "lerna run --stream --concurrency=1 test"

scripts/lint.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@ def lint():
6060
["mypy", *PY_SRC],
6161
["python", "-m", "robot.tidy", "--inplace", *ALL_ROBOT],
6262
["rflint", *RFLINT, *ALL_ROBOT],
63-
["python", "scripts/atest.py", "--dryrun", "--console", "quiet"],
63+
["python", "scripts/atest.py", "--dryrun", "--console", "dotted"],
6464
["python", "scripts/nblint.py"],
6565
],
6666
)

0 commit comments

Comments
 (0)