Skip to content

Commit

Permalink
Also add license headers for .gni files
Browse files Browse the repository at this point in the history
[email protected]

Bug: 1213449
Change-Id: I3228629bbaa1c3824a721a93782356ec71855513
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/2919951
Commit-Queue: Tim van der Lippe <[email protected]>
Reviewed-by: Jack Franklin <[email protected]>
  • Loading branch information
TimvdLippe authored and Devtools-frontend LUCI CQ committed May 26, 2021
1 parent f2cebf1 commit 8b92954
Show file tree
Hide file tree
Showing 9 changed files with 15 additions and 12 deletions.
6 changes: 4 additions & 2 deletions PRESUBMIT.py
Original file line number Diff line number Diff line change
Expand Up @@ -342,10 +342,12 @@ def _CheckDevToolsPythonLikeFileLicenseHeaders(input_api, output_api):
'test')
scripts_directory = input_api.os_path.join(input_api.PresubmitLocalPath(),
'scripts')
config_directory = input_api.os_path.join(input_api.PresubmitLocalPath(),
'config')

default_linted_directories = [
front_end_directory, test_directory, scripts_directory,
inspector_overlay_directory
inspector_overlay_directory, config_directory
]

check_related_files = [lint_path]
Expand All @@ -355,7 +357,7 @@ def _CheckDevToolsPythonLikeFileLicenseHeaders(input_api, output_api):

should_bail_out, files_to_lint = _getFilesToLint(
input_api, output_api, lint_config_files, default_linted_directories,
['BUILD.gn'], results)
['BUILD.gn', '.gni'], results)
if should_bail_out:
return results

Expand Down
4 changes: 2 additions & 2 deletions scripts/build/ninja/copy.gni
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
# Copyright 2019 The Chromium Authors. All rights reserved.
# Copyright 2021 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.

import("./node.gni")
import("./vars.gni")

template("copy_to_gen") {
node_action(target_name) {
forward_variables_from(invoker,
Expand Down
2 changes: 1 addition & 1 deletion scripts/build/ninja/devtools_entrypoint.gni
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Copyright 2020 The Chromium Authors. All rights reserved.
# Copyright 2021 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.

Expand Down
2 changes: 1 addition & 1 deletion scripts/build/ninja/devtools_module.gni
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Copyright 2020 The Chromium Authors. All rights reserved.
# Copyright 2021 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.

Expand Down
2 changes: 1 addition & 1 deletion scripts/build/ninja/devtools_pre_built.gni
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Copyright 2020 The Chromium Authors. All rights reserved.
# Copyright 2021 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.

Expand Down
2 changes: 1 addition & 1 deletion scripts/build/ninja/node.gni
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Copyright 2020 The Chromium Authors. All rights reserved.
# Copyright 2021 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.

Expand Down
2 changes: 1 addition & 1 deletion scripts/build/ninja/rollup.gni
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Copyright 2020 The Chromium Authors. All rights reserved.
# Copyright 2021 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.

Expand Down
2 changes: 1 addition & 1 deletion scripts/build/ninja/vars.gni
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Copyright 2020 The Chromium Authors. All rights reserved.
# Copyright 2021 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.

Expand Down
5 changes: 3 additions & 2 deletions scripts/test/run_header_check_python_like_files.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ const FRONT_END_DIRECTORY = path.join(ROOT_DIRECTORY, 'front_end');
const TEST_DIRECTORY = path.join(ROOT_DIRECTORY, 'test');
const SCRIPTS_DIRECTORY = path.join(ROOT_DIRECTORY, 'scripts');
const INSPECTOR_OVERLAY_DIRECTORY = path.join(ROOT_DIRECTORY, 'inspector_overlay');
const CONFIG_DIRECTORY = path.join(ROOT_DIRECTORY, 'config');

const CURRENT_YEAR = new Date().getFullYear();
const LINE_LICENSE_HEADER = [
Expand Down Expand Up @@ -76,8 +77,8 @@ let filesToLint = process.argv.slice(2);

if (filesToLint.length === 0) {
const topLevelDirectories =
[FRONT_END_DIRECTORY, SCRIPTS_DIRECTORY, TEST_DIRECTORY, INSPECTOR_OVERLAY_DIRECTORY].join(',');
filesToLint = glob.sync(`{${topLevelDirectories}}/**/BUILD.gn`);
[FRONT_END_DIRECTORY, SCRIPTS_DIRECTORY, TEST_DIRECTORY, INSPECTOR_OVERLAY_DIRECTORY, CONFIG_DIRECTORY].join(',');
filesToLint = glob.sync(`{${topLevelDirectories}}/**/{BUILD.gn,*.gni}`);
}

for (const fileLocation of filesToLint) {
Expand Down

0 comments on commit 8b92954

Please sign in to comment.