Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion build
Original file line number Diff line number Diff line change
Expand Up @@ -28,4 +28,4 @@ pyflakes "${SOURCE_DIR}/" "${TEST_DIR}/"

# Check docstrings for style consistency.
PYTHONPATH=$PYTHONPATH:$(pwd)/third_party/docstringchecker \
pylint --reports=n "$SOURCE_DIR" "$TEST_DIR"
pylint --reports=n --rcfile=.pylintrc "$SOURCE_DIR" "$TEST_DIR"
6 changes: 5 additions & 1 deletion dev_requirements.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,8 @@
# pylint versions prior to 1.5.0 require this specific version of astroid.
astroid==1.3.8
mock
pyflakes==1.6.0
pylint==1.8.2
# We use pylint exclusively to run the DocStringChecker linter and that linter
# expects pre-1.5.0 pylint syntax.
pylint==1.4.4
yapf==0.20.1
2 changes: 1 addition & 1 deletion third_party/docstringchecker/lint.py
Original file line number Diff line number Diff line change
Expand Up @@ -147,7 +147,7 @@ def _docstring_indent(node):
if node.display_type() == 'Module':
return 0
else:
return node.col_offset + 2
return node.col_offset + 4

def _check_common(self, node, lines=None):
"""Common checks we enforce on all docstrings"""
Expand Down
5 changes: 4 additions & 1 deletion third_party/docstringchecker/update.sh
100755 → 100644
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,10 @@ set -x
OUTPUT_DIR=$(dirname "$0")
OUTPUT_FILE="${OUTPUT_DIR}/lint.py"

# Modify DocStringChecker to expect 4-space indents instead of 2 to match Google
# Python style guide.
wget \
https://chromium.googlesource.com/chromiumos/chromite/+/master/cli/cros/lint.py?format=TEXT \
-O - | \
base64 --decode > "$OUTPUT_FILE"
base64 --decode | sed "s/return node.col_offset + 2/return node.col_offset + 4/" \
> "$OUTPUT_FILE"