Skip to content

Commit 6047b3f

Browse files
authored
Fix cosmetic variations in copyrights and license files (flutter#3730)
- Replaces "the Flutter project authors" with the repo-standard version "The Flutter Authors" - Updates the license check not to allow "the Flutter project authors" in the future - Fixes a few minor cosmetic variations that had crept back into LICENSE files since my mass-standardization of those files. - Updates the license check to validate those to prevent such drift in the future.
1 parent c870bbb commit 6047b3f

File tree

26 files changed

+263
-94
lines changed

26 files changed

+263
-94
lines changed

packages/connectivity/connectivity_for_web/LICENSE

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
Copyright 2016, the Flutter project authors. All rights reserved.
1+
Copyright 2016 The Flutter Authors. All rights reserved.
22

33
Redistribution and use in source and binary forms, with or without modification,
44
are permitted provided that the following conditions are met:

packages/file_selector/file_selector/LICENSE

+1-1
Original file line numberDiff line numberDiff line change
@@ -22,4 +22,4 @@ ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
2222
LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
2323
ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
2424
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
25-
SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
25+
SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.

packages/file_selector/file_selector_platform_interface/LICENSE

+1-1
Original file line numberDiff line numberDiff line change
@@ -22,4 +22,4 @@ ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
2222
LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
2323
ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
2424
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
25-
SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
25+
SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.

packages/file_selector/file_selector_web/LICENSE

+1-1
Original file line numberDiff line numberDiff line change
@@ -22,4 +22,4 @@ ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
2222
LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
2323
ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
2424
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
25-
SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
25+
SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.

packages/google_maps_flutter/google_maps_flutter_web/LICENSE

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
Copyright 2017, the Flutter project authors. All rights reserved.
1+
Copyright 2017 The Flutter Authors. All rights reserved.
22

33
Redistribution and use in source and binary forms, with or without modification,
44
are permitted provided that the following conditions are met:

packages/google_sign_in/google_sign_in/LICENSE

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
Copyright 2016, the Flutter project authors. All rights reserved.
1+
Copyright 2016 The Flutter Authors. All rights reserved.
22

33
Redistribution and use in source and binary forms, with or without modification,
44
are permitted provided that the following conditions are met:

packages/google_sign_in/google_sign_in/android/src/main/java/io/flutter/plugins/googlesignin/BackgroundTaskRunner.java

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// Copyright 2017, the Flutter project authors. All rights reserved.
1+
// Copyright 2017 The Flutter Authors. All rights reserved.
22
// Use of this source code is governed by a BSD-style license that can be
33
// found in the LICENSE file.
44

packages/google_sign_in/google_sign_in/android/src/main/java/io/flutter/plugins/googlesignin/Executors.java

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// Copyright 2017, the Flutter project authors. All rights reserved.
1+
// Copyright 2017 The Flutter Authors. All rights reserved.
22
// Use of this source code is governed by a BSD-style license that can be
33
// found in the LICENSE file.
44

packages/google_sign_in/google_sign_in/android/src/main/java/io/flutter/plugins/googlesignin/GoogleSignInPlugin.java

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// Copyright 2017, the Flutter project authors. All rights reserved.
1+
// Copyright 2017 The Flutter Authors. All rights reserved.
22
// Use of this source code is governed by a BSD-style license that can be
33
// found in the LICENSE file.
44

packages/google_sign_in/google_sign_in/android/src/main/java/io/flutter/plugins/googlesignin/GoogleSignInWrapper.java

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// Copyright 2020, the Flutter project authors. All rights reserved.
1+
// Copyright 2020 The Flutter Authors. All rights reserved.
22
// Use of this source code is governed by a BSD-style license that can be
33
// found in the LICENSE file.
44

packages/google_sign_in/google_sign_in/integration_test/google_sign_in_test.dart

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// Copyright 2017, the Flutter project authors. All rights reserved.
1+
// Copyright 2017 The Flutter Authors. All rights reserved.
22
// Use of this source code is governed by a BSD-style license that can be
33
// found in the LICENSE file.
44

packages/google_sign_in/google_sign_in/ios/Classes/FLTGoogleSignInPlugin.h

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// Copyright 2017, the Flutter project authors. All rights reserved.
1+
// Copyright 2017 The Flutter Authors. All rights reserved.
22
// Use of this source code is governed by a BSD-style license that can be
33
// found in the LICENSE file.
44

packages/google_sign_in/google_sign_in/ios/Classes/FLTGoogleSignInPlugin.m

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// Copyright 2017, the Flutter project authors. All rights reserved.
1+
// Copyright 2017 The Flutter Authors. All rights reserved.
22
// Use of this source code is governed by a BSD-style license that can be
33
// found in the LICENSE file.
44

packages/google_sign_in/google_sign_in/lib/google_sign_in.dart

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// Copyright 2017, the Flutter project authors. All rights reserved.
1+
// Copyright 2017 The Flutter Authors. All rights reserved.
22
// Use of this source code is governed by a BSD-style license that can be
33
// found in the LICENSE file.
44

packages/google_sign_in/google_sign_in/lib/src/common.dart

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// Copyright 2017, the Flutter project authors. All rights reserved.
1+
// Copyright 2017 The Flutter Authors. All rights reserved.
22
// Use of this source code is governed by a BSD-style license that can be
33
// found in the LICENSE file.
44

packages/google_sign_in/google_sign_in/lib/widgets.dart

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// Copyright 2017, the Flutter project authors. All rights reserved.
1+
// Copyright 2017 The Flutter Authors. All rights reserved.
22
// Use of this source code is governed by a BSD-style license that can be
33
// found in the LICENSE file.
44

packages/google_sign_in/google_sign_in_web/LICENSE

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
Copyright 2016, the Flutter project authors. All rights reserved.
1+
Copyright 2016 The Flutter Authors. All rights reserved.
22

33
Redistribution and use in source and binary forms, with or without modification,
44
are permitted provided that the following conditions are met:

packages/google_sign_in/google_sign_in_web/test/tests_exist_elsewhere_test.dart

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// Copyright 2019, the Flutter project authors. All rights reserved.
1+
// Copyright 2019 The Flutter Authors. All rights reserved.
22
// Use of this source code is governed by a BSD-style license that can be
33
// found in the LICENSE file.
44

packages/image_picker/image_picker/LICENSE

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
image_picker
22

3-
Copyright 2017, the Flutter project authors. All rights reserved.
3+
Copyright 2017 The Flutter Authors. All rights reserved.
44

55
Redistribution and use in source and binary forms, with or without modification,
66
are permitted provided that the following conditions are met:

packages/path_provider/path_provider/LICENSE

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
Copyright 2017, the Flutter project authors. All rights reserved.
1+
Copyright 2017 The Flutter Authors. All rights reserved.
22

33
Redistribution and use in source and binary forms, with or without modification,
44
are permitted provided that the following conditions are met:

packages/share/LICENSE

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
Copyright 2017, the Flutter project authors. All rights reserved.
1+
Copyright 2017 The Flutter Authors. All rights reserved.
22

33
Redistribution and use in source and binary forms, with or without modification,
44
are permitted provided that the following conditions are met:

packages/shared_preferences/shared_preferences_macos/LICENSE

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
Copyright 2017, the Flutter project authors. All rights reserved.
1+
Copyright 2017 The Flutter Authors. All rights reserved.
22

33
Redistribution and use in source and binary forms, with or without modification,
44
are permitted provided that the following conditions are met:
Original file line numberDiff line numberDiff line change
@@ -1,27 +1,25 @@
1-
// Copyright 2017 The Chromium Authors. All rights reserved.
2-
//
3-
// Redistribution and use in source and binary forms, with or without
4-
// modification, are permitted provided that the following conditions are
5-
// met:
6-
//
7-
// * Redistributions of source code must retain the above copyright
8-
// notice, this list of conditions and the following disclaimer.
9-
// * Redistributions in binary form must reproduce the above
10-
// copyright notice, this list of conditions and the following disclaimer
11-
// in the documentation and/or other materials provided with the
12-
// distribution.
13-
// * Neither the name of Google Inc. nor the names of its
14-
// contributors may be used to endorse or promote products derived from
15-
// this software without specific prior written permission.
16-
//
17-
// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
18-
// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
19-
// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
20-
// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
21-
// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
22-
// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
23-
// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
24-
// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
25-
// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
26-
// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
27-
// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
1+
Copyright 2017 The Chromium Authors. All rights reserved.
2+
3+
Redistribution and use in source and binary forms, with or without modification,
4+
are permitted provided that the following conditions are met:
5+
6+
* Redistributions of source code must retain the above copyright
7+
notice, this list of conditions and the following disclaimer.
8+
* Redistributions in binary form must reproduce the above
9+
copyright notice, this list of conditions and the following
10+
disclaimer in the documentation and/or other materials provided
11+
with the distribution.
12+
* Neither the name of Google Inc. nor the names of its
13+
contributors may be used to endorse or promote products derived
14+
from this software without specific prior written permission.
15+
16+
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
17+
ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
18+
WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
19+
DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR
20+
ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
21+
(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
22+
LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
23+
ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
24+
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
25+
SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
Original file line numberDiff line numberDiff line change
@@ -1,27 +1,25 @@
1-
// Copyright 2017 The Chromium Authors. All rights reserved.
2-
//
3-
// Redistribution and use in source and binary forms, with or without
4-
// modification, are permitted provided that the following conditions are
5-
// met:
6-
//
7-
// * Redistributions of source code must retain the above copyright
8-
// notice, this list of conditions and the following disclaimer.
9-
// * Redistributions in binary form must reproduce the above
10-
// copyright notice, this list of conditions and the following disclaimer
11-
// in the documentation and/or other materials provided with the
12-
// distribution.
13-
// * Neither the name of Google Inc. nor the names of its
14-
// contributors may be used to endorse or promote products derived from
15-
// this software without specific prior written permission.
16-
//
17-
// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
18-
// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
19-
// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
20-
// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
21-
// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
22-
// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
23-
// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
24-
// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
25-
// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
26-
// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
27-
// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
1+
Copyright 2017 The Chromium Authors. All rights reserved.
2+
3+
Redistribution and use in source and binary forms, with or without modification,
4+
are permitted provided that the following conditions are met:
5+
6+
* Redistributions of source code must retain the above copyright
7+
notice, this list of conditions and the following disclaimer.
8+
* Redistributions in binary form must reproduce the above
9+
copyright notice, this list of conditions and the following
10+
disclaimer in the documentation and/or other materials provided
11+
with the distribution.
12+
* Neither the name of Google Inc. nor the names of its
13+
contributors may be used to endorse or promote products derived
14+
from this software without specific prior written permission.
15+
16+
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
17+
ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
18+
WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
19+
DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR
20+
ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
21+
(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
22+
LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
23+
ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
24+
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
25+
SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.

script/tool/lib/src/license_check_command.dart

+77-9
Original file line numberDiff line numberDiff line change
@@ -66,9 +66,40 @@ final List<String> _firstPartyAuthors = <String>[
6666
'The Chromium Authors',
6767
'the Chromium project authors',
6868
'The Flutter Authors',
69-
'the Flutter project authors',
7069
];
7170

71+
// The exact format of the BSD license that our license files should contain.
72+
// Slight variants are not accepted because they may prevent consolidation in
73+
// tools that assemble all licenses used in distributed applications.
74+
//
75+
// TODO(stuartmorgan): Add the copyright string here once that's completely
76+
// standardized.
77+
final String _fullBsdLicenseText = '''
78+
Redistribution and use in source and binary forms, with or without modification,
79+
are permitted provided that the following conditions are met:
80+
81+
* Redistributions of source code must retain the above copyright
82+
notice, this list of conditions and the following disclaimer.
83+
* Redistributions in binary form must reproduce the above
84+
copyright notice, this list of conditions and the following
85+
disclaimer in the documentation and/or other materials provided
86+
with the distribution.
87+
* Neither the name of Google Inc. nor the names of its
88+
contributors may be used to endorse or promote products derived
89+
from this software without specific prior written permission.
90+
91+
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
92+
ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
93+
WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
94+
DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR
95+
ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
96+
(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
97+
LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
98+
ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
99+
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
100+
SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
101+
''';
102+
72103
/// Validates that code files have copyright and license blocks.
73104
class LicenseCheckCommand extends PluginCommand {
74105
/// Creates a new license check command for [packagesDir].
@@ -90,13 +121,19 @@ class LicenseCheckCommand extends PluginCommand {
90121

91122
@override
92123
Future<Null> run() async {
93-
Iterable<File> codeFiles = (await _getAllFiles()).where((File file) =>
124+
final Iterable<File> codeFiles = (await _getAllFiles()).where((File file) =>
94125
_codeFileExtensions.contains(p.extension(file.path)) &&
95126
!_shouldIgnoreFile(file));
127+
final Iterable<File> firstPartyLicenseFiles = (await _getAllFiles()).where(
128+
(File file) =>
129+
p.basename(file.basename) == 'LICENSE' && !_isThirdParty(file));
96130

97-
bool succeeded = await _checkLicenses(codeFiles);
131+
final bool copyrightCheckSucceeded = await _checkCodeLicenses(codeFiles);
132+
print('\n=======================================\n');
133+
final bool licenseCheckSucceeded =
134+
await _checkLicenseFiles(firstPartyLicenseFiles);
98135

99-
if (!succeeded) {
136+
if (!copyrightCheckSucceeded || !licenseCheckSucceeded) {
100137
throw ToolExit(1);
101138
}
102139
}
@@ -110,7 +147,7 @@ class LicenseCheckCommand extends PluginCommand {
110147

111148
// Checks all license blocks for [codeFiles], returning false if any of them
112149
// fail validation.
113-
Future<bool> _checkLicenses(Iterable<File> codeFiles) async {
150+
Future<bool> _checkCodeLicenses(Iterable<File> codeFiles) async {
114151
final List<File> filesWithoutDetectedCopyright = <File>[];
115152
final List<File> filesWithoutDetectedLicense = <File>[];
116153
final List<File> misplacedThirdPartyFiles = <File>[];
@@ -133,8 +170,7 @@ class LicenseCheckCommand extends PluginCommand {
133170
continue;
134171
}
135172
final String author = copyright.group(1);
136-
if (!_firstPartyAuthors.contains(author) &&
137-
!p.split(file.path).contains('third_party')) {
173+
if (!_firstPartyAuthors.contains(author) && !_isThirdParty(file)) {
138174
misplacedThirdPartyFiles.add(file);
139175
}
140176

@@ -146,7 +182,7 @@ class LicenseCheckCommand extends PluginCommand {
146182
filesWithoutDetectedLicense.add(file);
147183
}
148184
}
149-
_print('\n\n');
185+
_print('\n');
150186

151187
// Sort by path for more usable output.
152188
final pathCompare = (File a, File b) => a.path.compareTo(b.path);
@@ -188,7 +224,35 @@ class LicenseCheckCommand extends PluginCommand {
188224
filesWithoutDetectedLicense.isEmpty &&
189225
misplacedThirdPartyFiles.isEmpty;
190226
if (succeeded) {
191-
_print('All files passed validation!');
227+
_print('All source files passed validation!');
228+
}
229+
return succeeded;
230+
}
231+
232+
// Checks all provide LICENSE files, returning false if any of them
233+
// fail validation.
234+
Future<bool> _checkLicenseFiles(Iterable<File> files) async {
235+
final List<File> incorrectLicenseFiles = <File>[];
236+
237+
for (final File file in files) {
238+
_print('Checking ${file.path}');
239+
if (!file.readAsStringSync().contains(_fullBsdLicenseText)) {
240+
incorrectLicenseFiles.add(file);
241+
}
242+
}
243+
_print('\n');
244+
245+
if (incorrectLicenseFiles.isNotEmpty) {
246+
_print('The following LICENSE files do not follow the expected format:');
247+
for (final File file in incorrectLicenseFiles) {
248+
_print(' ${file.path}');
249+
}
250+
_print('Please ensure that they use the exact format used in this repository".\n');
251+
}
252+
253+
bool succeeded = incorrectLicenseFiles.isEmpty;
254+
if (succeeded) {
255+
_print('All LICENSE files passed validation!');
192256
}
193257
return succeeded;
194258
}
@@ -201,6 +265,10 @@ class LicenseCheckCommand extends PluginCommand {
201265
_ignoredFullBasenameList.contains(p.basename(path)));
202266
}
203267

268+
bool _isThirdParty(File file) {
269+
return p.split(file.path).contains('third_party');
270+
}
271+
204272
Future<List<File>> _getAllFiles() => packagesDir.parent
205273
.list(recursive: true, followLinks: false)
206274
.where((FileSystemEntity entity) => entity is File)

0 commit comments

Comments
 (0)