Skip to content
This repository has been archived by the owner on Mar 21, 2022. It is now read-only.

Fix for issue 26: Default to CMakeLists.txt in current directory #35

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
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
5 changes: 4 additions & 1 deletion cmakelint/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -87,6 +87,7 @@
whitespace/newline
whitespace/tabs
"""
_DEFAULT_FILENAME = 'CMakeLists.txt'

def DefaultRC():
"""
Expand Down Expand Up @@ -588,8 +589,10 @@ def ParseArgs(argv):
except ValueError as ex:
PrintUsage(str(ex))

if not filenames:
if not filenames and not os.path.isfile(_DEFAULT_FILENAME):
PrintUsage('No files were specified!')
elif os.path.isfile(_DEFAULT_FILENAME):
filenames = [_DEFAULT_FILENAME]
return filenames

def main():
Expand Down