Skip to content
Closed
Changes from 1 commit
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
Prev Previous commit
Next Next commit
Update cpplint.py
stay within 80 cols
  • Loading branch information
sharkfisher authored Oct 10, 2017
commit 9a68c5a3348066a4820b6c0c478ea7cc02b827ad
4 changes: 2 additions & 2 deletions tools/cpplint.py
Original file line number Diff line number Diff line change
Expand Up @@ -1074,8 +1074,8 @@ def RepositoryName(self):
"""
fullname = self.FullName()
# XXX(bnoordhuis) Expects that cpplint.py lives in the tools/ directory.
toplevel = os.path.abspath(
os.path.join(os.path.dirname(__file__), '..')).replace('\\', '/').decode('utf-8')
toplevel = os.path.abspath(os.path.join(os.path.dirname(__file__), '..')) \
.replace('\\', '/').decode('utf-8')

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This might be a little easier to read as:

toplevel = os.path.abspath(...)
toplevel = toplevel.decode('utf-8')

prefix = os.path.commonprefix([fullname, toplevel])
return fullname[len(prefix) + 1:]

Expand Down