Skip to content

Commit a53672d

Browse files
TimvdLippeDevtools-frontend LUCI CQ
authored and
Devtools-frontend LUCI CQ
committed
Check license headers for CSS files during PRESUBMIT
This mirrors the license header checks we perform for Python-like files and apply the same logic for CSS. To do so, we modify the relevant regexes and patch function to use the correct version of comment structure for CSS files (which use `/*` rather than `#` as delimiters). [email protected] Bug: 1106746 Change-Id: I51d51e9b793a1015aeb20a3b3a55e075c2ee748f Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/3014756 Commit-Queue: Tim van der Lippe <[email protected]> Auto-Submit: Tim van der Lippe <[email protected]> Reviewed-by: Jack Franklin <[email protected]>
1 parent e1bf190 commit a53672d

31 files changed

+286
-107
lines changed

PRESUBMIT.py

+7-7
Original file line numberDiff line numberDiff line change
@@ -324,14 +324,14 @@ def _CheckDevToolsStyleCSS(input_api, output_api):
324324
return results
325325

326326

327-
def _CheckDevToolsPythonLikeFileLicenseHeaders(input_api, output_api):
327+
def _CheckDevToolsNonJSFileLicenseHeaders(input_api, output_api):
328328
results = [
329329
output_api.PresubmitNotifyResult(
330330
'Python-like file license header check:')
331331
]
332-
lint_path = input_api.os_path.join(
333-
input_api.PresubmitLocalPath(), 'scripts', 'test',
334-
'run_header_check_python_like_files.js')
332+
lint_path = input_api.os_path.join(input_api.PresubmitLocalPath(),
333+
'scripts', 'test',
334+
'run_header_check_non_js_files.js')
335335

336336
front_end_directory = input_api.os_path.join(
337337
input_api.PresubmitLocalPath(), 'front_end')
@@ -356,7 +356,7 @@ def _CheckDevToolsPythonLikeFileLicenseHeaders(input_api, output_api):
356356

357357
should_bail_out, files_to_lint = _getFilesToLint(
358358
input_api, output_api, lint_config_files, default_linted_directories,
359-
['BUILD.gn', '.gni'], results)
359+
['BUILD.gn', '.gni', '.css'], results)
360360
if should_bail_out:
361361
return results
362362

@@ -516,8 +516,8 @@ def _CommonChecks(input_api, output_api):
516516
results.extend(_CheckJSON(input_api, output_api))
517517
results.extend(_CheckDevToolsStyleJS(input_api, output_api))
518518
results.extend(_CheckDevToolsStyleCSS(input_api, output_api))
519-
results.extend(
520-
_CheckDevToolsPythonLikeFileLicenseHeaders(input_api, output_api))
519+
results.extend(_CheckDevToolsNonJSFileLicenseHeaders(
520+
input_api, output_api))
521521

522522
results.extend(_CheckFormat(input_api, output_api))
523523
results.extend(_CheckChangesAreExclusiveToDirectory(input_api, output_api))

front_end/panels/application/backgroundServiceView.css

+6
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,9 @@
1+
/*
2+
* Copyright 2021 The Chromium Authors. All rights reserved.
3+
* Use of this source code is governed by a BSD-style license that can be
4+
* found in the LICENSE file.
5+
*/
6+
17
.background-service-toolbar {
28
background-color: var(--color-background-elevation-1);
39
border-bottom: var(--legacy-divider-border);

front_end/panels/changes/changesSidebar.css

+6
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,9 @@
1+
/*
2+
* Copyright 2021 The Chromium Authors. All rights reserved.
3+
* Use of this source code is governed by a BSD-style license that can be
4+
* found in the LICENSE file.
5+
*/
6+
17
.tree-outline {
28
/**
39
* These variables (and the dark mode variants) are duplicated from

front_end/panels/coverage/coverageListView.css

+6
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,9 @@
1+
/*
2+
* Copyright 2021 The Chromium Authors. All rights reserved.
3+
* Use of this source code is governed by a BSD-style license that can be
4+
* found in the LICENSE file.
5+
*/
6+
17
.data-grid {
28
border: none;
39
}

front_end/panels/elements/components/cssQuery.css

+6
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,9 @@
1+
/*
2+
* Copyright 2021 The Chromium Authors. All rights reserved.
3+
* Use of this source code is governed by a BSD-style license that can be
4+
* found in the LICENSE file.
5+
*/
6+
17
.query:not(.editing-query) {
28
overflow: hidden;
39
}

front_end/panels/elements/components/elementsPanelLink.css

+2-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
1-
/* Copyright 2021 The Chromium Authors. All rights reserved.
1+
/*
2+
* Copyright 2021 The Chromium Authors. All rights reserved.
23
* Use of this source code is governed by a BSD-style license that can be
34
* found in the LICENSE file.
45
*/

front_end/panels/elements/components/queryContainer.css

+6
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,9 @@
1+
/*
2+
* Copyright 2021 The Chromium Authors. All rights reserved.
3+
* Use of this source code is governed by a BSD-style license that can be
4+
* found in the LICENSE file.
5+
*/
6+
17
.container-link {
28
color: var(--color-text-primary);
39
}

front_end/panels/elements/layoutPane.css

+6
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,9 @@
1+
/*
2+
* Copyright 2021 The Chromium Authors. All rights reserved.
3+
* Use of this source code is governed by a BSD-style license that can be
4+
* found in the LICENSE file.
5+
*/
6+
17
* {
28
box-sizing: border-box;
39
font-size: 12px;

front_end/panels/network/networkWaterfallColumn.css

+2-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
1-
/* Copyright 2016 The Chromium Authors. All rights reserved.
1+
/*
2+
* Copyright 2016 The Chromium Authors. All rights reserved.
23
* Use of this source code is governed by a BSD-style license that can be
34
* found in the LICENSE file.
45
*/

front_end/panels/security/lockIcon.css

+2-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
1-
/* Copyright (c) 2015 The Chromium Authors. All rights reserved.
1+
/*
2+
* Copyright 2015 The Chromium Authors. All rights reserved.
23
* Use of this source code is governed by a BSD-style license that can be
34
* found in the LICENSE file.
45
*/

front_end/panels/security/mainView.css

+2-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
1-
/* Copyright (c) 2015 The Chromium Authors. All rights reserved.
1+
/*
2+
* Copyright 2015 The Chromium Authors. All rights reserved.
23
* Use of this source code is governed by a BSD-style license that can be
34
* found in the LICENSE file.
45
*/

front_end/panels/security/originView.css

+2-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
1-
/* Copyright (c) 2015 The Chromium Authors. All rights reserved.
1+
/*
2+
* Copyright 2015 The Chromium Authors. All rights reserved.
23
* Use of this source code is governed by a BSD-style license that can be
34
* found in the LICENSE file.
45
*/

front_end/panels/security/sidebar.css

+2-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
1-
/* Copyright (c) 2015 The Chromium Authors. All rights reserved.
1+
/*
2+
* Copyright 2015 The Chromium Authors. All rights reserved.
23
* Use of this source code is governed by a BSD-style license that can be
34
* found in the LICENSE file.
45
*/

front_end/ui/components/icon_button/icon.css

+4-2
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
1-
/* Copyright 2021 The Chromium Authors. All rights reserved.
1+
/*
2+
* Copyright 2021 The Chromium Authors. All rights reserved.
23
* Use of this source code is governed by a BSD-style license that can be
3-
* found in the LICENSE file. */
4+
* found in the LICENSE file.
5+
*/
46

57
:host {
68
display: inline-block;

front_end/ui/components/icon_button/iconButton.css

+4-2
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
1-
/* Copyright 2021 The Chromium Authors. All rights reserved.
1+
/*
2+
* Copyright 2021 The Chromium Authors. All rights reserved.
23
* Use of this source code is governed by a BSD-style license that can be
3-
* found in the LICENSE file. */
4+
* found in the LICENSE file.
5+
*/
46

57
:host {
68
white-space: normal;

front_end/ui/legacy/components/color_picker/spectrum.css

+6
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,9 @@
1+
/*
2+
* Copyright 2021 The Chromium Authors. All rights reserved.
3+
* Use of this source code is governed by a BSD-style license that can be
4+
* found in the LICENSE file.
5+
*/
6+
17
/* https://github.com/bgrins/spectrum */
28

39
:host {

front_end/ui/legacy/components/data_grid/dataGrid.css

+6
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,9 @@
1+
/*
2+
* Copyright 2021 The Chromium Authors. All rights reserved.
3+
* Use of this source code is governed by a BSD-style license that can be
4+
* found in the LICENSE file.
5+
*/
6+
17
.data-grid {
28
position: relative;
39
border: 1px solid var(--color-details-hairline-light) !important; /* stylelint-disable-line declaration-no-important */

front_end/ui/legacy/components/source_frame/jsonView.css

+6
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,9 @@
1+
/*
2+
* Copyright 2021 The Chromium Authors. All rights reserved.
3+
* Use of this source code is governed by a BSD-style license that can be
4+
* found in the LICENSE file.
5+
*/
6+
17
.json-view {
28
padding: 2px 6px;
39
overflow: auto;

front_end/ui/legacy/components/text_editor/cmdevtools.css

+6
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,9 @@
1+
/*
2+
* Copyright 2021 The Chromium Authors. All rights reserved.
3+
* Use of this source code is governed by a BSD-style license that can be
4+
* found in the LICENSE file.
5+
*/
6+
17
/* stylelint-disable no-descending-specificity */
28

39
/**

front_end/ui/legacy/inspectorScrollbars.css

+3-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,9 @@
1-
/* Copyright 2020 The Chromium Authors. All rights reserved.
1+
/*
2+
* Copyright 2020 The Chromium Authors. All rights reserved.
23
* Use of this source code is governed by a BSD-style license that can be
34
* found in the LICENSE file.
45
*/
6+
57
/* Dark mode scrollbar styling overrides */
68

79
:not(.platform-mac).-theme-with-dark-background ::-webkit-scrollbar {

front_end/ui/legacy/themeColors.css

+3-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,9 @@
1-
/* Copyright 2020 The Chromium Authors. All rights reserved.
1+
/*
2+
* Copyright 2020 The Chromium Authors. All rights reserved.
23
* Use of this source code is governed by a BSD-style license that can be
34
* found in the LICENSE file.
45
*/
6+
57
/**
68
* These are the new set of colors for the new Light/Dark themes. See
79
* https://crbug.com/1122511 and

inspector_overlay/tool_grid.css

+6
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,9 @@
1+
/*
2+
* Copyright 2021 The Chromium Authors. All rights reserved.
3+
* Use of this source code is governed by a BSD-style license that can be
4+
* found in the LICENSE file.
5+
*/
6+
17
@media (forced-colors: active) {
28
:root,
39
body {

inspector_overlay/tool_highlight.css

+6
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,9 @@
1+
/*
2+
* Copyright 2021 The Chromium Authors. All rights reserved.
3+
* Use of this source code is governed by a BSD-style license that can be
4+
* found in the LICENSE file.
5+
*/
6+
17
body {
28
--arrow-width: 15px;
39
--arrow-height: 8px;

inspector_overlay/tool_paused.css

+6
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,9 @@
1+
/*
2+
* Copyright 2021 The Chromium Authors. All rights reserved.
3+
* Use of this source code is governed by a BSD-style license that can be
4+
* found in the LICENSE file.
5+
*/
6+
17
body {
28
background-color: rgb(0 0 0 / 31%);
39
}

inspector_overlay/tool_screenshot.css

+6
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,9 @@
1+
/*
2+
* Copyright 2021 The Chromium Authors. All rights reserved.
3+
* Use of this source code is governed by a BSD-style license that can be
4+
* found in the LICENSE file.
5+
*/
6+
17
body {
28
cursor: crosshair;
39
}

inspector_overlay/tool_source_order.css

+6
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,9 @@
1+
/*
2+
* Copyright 2021 The Chromium Authors. All rights reserved.
3+
* Use of this source code is governed by a BSD-style license that can be
4+
* found in the LICENSE file.
5+
*/
6+
17
:root {
28
--border-radius: 4px;
39
}
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1-
/* Copyright 2021 The Chromium Authors. All rights reserved.
1+
/*
2+
* Copyright 2021 The Chromium Authors. All rights reserved.
23
* Use of this source code is governed by a BSD-style license that can be
3-
* found in the LICENSE file. */
4+
* found in the LICENSE file.
5+
*/

0 commit comments

Comments
 (0)