Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1891)

Unified Diff: slave/skia_slave_scripts/newline_checker.py

Issue 648353002: Remove Skia's forked buildbot code (Closed) Base URL: https://skia.googlesource.com/buildbot.git@master
Patch Set: Address comment Created 6 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « slave/skia_slave_scripts/merge_into_android.py ('k') | slave/skia_slave_scripts/page_sets/data/README » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: slave/skia_slave_scripts/newline_checker.py
diff --git a/slave/skia_slave_scripts/newline_checker.py b/slave/skia_slave_scripts/newline_checker.py
deleted file mode 100644
index c0ed857bbf1b34ac229dd81936596649fc934f2d..0000000000000000000000000000000000000000
--- a/slave/skia_slave_scripts/newline_checker.py
+++ /dev/null
@@ -1,43 +0,0 @@
-#!/usr/bin/env python
-# Copyright (c) 2012 The Chromium Authors. All rights reserved.
-# Use of this source code is governed by a BSD-style license that can be
-# found in the LICENSE file.
-
-""" Newline checking step """
-
-import os
-import sys
-
-
-_FILE_SUFFIXES_TO_CHECK = ['.cpp', '.h', '.c']
-
-_SUBDIRS_TO_IGNORE = ['.svn', 'third_party']
-
-
-def NewlineChecker():
- files_without_trailing_newlines = _ListFiles(
- os.getcwd()) # Assuming current directory is trunk.
- if files_without_trailing_newlines:
- raise Exception(
- 'The following file(s) have no newlines at the end:\n %s' % (
- '\n'.join(files_without_trailing_newlines)))
-
-
-def _ListFiles(directory):
- files_without_trailing_newlines = []
- for item in os.listdir(directory):
- full_item_path = os.path.join(directory, item)
- if os.path.isfile(full_item_path):
- for suffix in _FILE_SUFFIXES_TO_CHECK:
- if item.endswith(suffix):
- file_content = file(full_item_path).read()
- if file_content and file_content[-1] != '\n':
- files_without_trailing_newlines.append(full_item_path)
- elif item not in _SUBDIRS_TO_IGNORE:
- files_without_trailing_newlines.extend(_ListFiles(full_item_path))
- return files_without_trailing_newlines
-
-
-if '__main__' == __name__:
- sys.exit(NewlineChecker())
-
« no previous file with comments | « slave/skia_slave_scripts/merge_into_android.py ('k') | slave/skia_slave_scripts/page_sets/data/README » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698