From 6e96a91f24b0c0d68712cb792abb0840437f300e Mon Sep 17 00:00:00 2001 From: Aseda Aboagye Date: Fri, 18 Sep 2015 13:33:14 -0700 Subject: config_option_check.py: Ignore hidden files. When this script is searching through CONFIG_* options used in the repo, it should ignore hidden files. I uncovered this by accidentally having modified a file and the presubmit hook failed. This is because emacs auto-saves files with the format ".#filename.ext". Now, the script will ignore hidden files. BUG=None BRANCH=None TEST=Use emacs to modify a c file but not save it. Run the script and verify that no errors occur. TEST=make -j buildall tests Change-Id: Ie09cfcf66f2e416aeed99847945cb5168b457d1a Signed-off-by: Aseda Aboagye Reviewed-on: https://chromium-review.googlesource.com/300954 Commit-Ready: Aseda Aboagye Tested-by: Aseda Aboagye Reviewed-by: Randall Spangler --- util/config_option_check.py | 3 +++ 1 file changed, 3 insertions(+) (limited to 'util') diff --git a/util/config_option_check.py b/util/config_option_check.py index ea681a2787..95bb72a1f6 100755 --- a/util/config_option_check.py +++ b/util/config_option_check.py @@ -92,6 +92,9 @@ def obtain_config_options_in_use(): if 'private' in dirnames: dirnames.remove('private') for f in filenames: + # Ignore hidden files. + if f.startswith('.'): + continue # Only consider C source, assembler, and Make-style files. if (os.path.splitext(f)[1] in ('.c', '.h', '.inc', '.S', '.mk') or 'Makefile' in f): -- cgit v1.2.1