Skip to content

Commit b181b77

Browse files
hramosfacebook-github-bot
authored andcommitted
Check PATENTS does not creep into files
Summary: Some files have crept into the repo with the old license header. These are usually from PRs that were opened prior to the re-licensing of the project. Let the script run, prior to fixing the errant files. The script outputs the following: ``` PATENTS crept into some new files? --- /dev/fd/63 2018-03-01 01:42:48.250153746 +0000 +++ /dev/fd/62 2018-03-01 01:42:48.250153746 +0000 @@ -1 +1,9 @@ +Libraries/NativeAnimation/Nodes/RCTTrackingAnimatedNode.h +Libraries/NativeAnimation/Nodes/RCTTrackingAnimatedNode.m +ReactAndroid/src/main/java/com/facebook/react/animated/TrackingAnimatedNode.java +ReactAndroid/src/main/java/com/facebook/react/views/text/CustomLetterSpacingSpan.java +ReactCommon/yoga/yoga/YGLayout.cpp +ReactCommon/yoga/yoga/YGLayout.h +ReactCommon/yoga/yoga/YGStyle.cpp +ReactCommon/yoga/yoga/YGStyle.h scripts/circleci/check_license.sh Exited with code 1 ``` Fix the headers in these files and run the script again. No output, exit code 0. Closes #18143 Reviewed By: sophiebits Differential Revision: D7119356 Pulled By: hramos fbshipit-source-id: d238e4d4a3ae320a2c8e625c2fa29690057a4814
1 parent 8a7f68e commit b181b77

10 files changed

Lines changed: 42 additions & 35 deletions

File tree

.circleci/config.yml

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -152,6 +152,11 @@ aliases:
152152
command: yarn flow check
153153
when: always
154154

155+
- &run-license-checks
156+
name: Check license
157+
command: ./scripts/circleci/check_license.sh
158+
when: always
159+
155160
- &build-android-app
156161
name: Build Android App
157162
command: |
@@ -275,14 +280,15 @@ jobs:
275280

276281
# Runs JavaScript lint and flow checks.
277282
# Currently will fail a PR if lint/flow raises issues.
278-
js_checks:
283+
analyze:
279284
<<: *js_defaults
280285
steps:
281286
- attach_workspace:
282287
at: ~/react-native
283288

284289
- run: *run-lint-checks
285290
- run: *run-flow-checks
291+
- run: *run-license-checks
286292

287293
- store_test_results:
288294
path: ~/react-native/reports/junit
@@ -576,8 +582,8 @@ workflows:
576582
- checkout_code:
577583
filters: *filter-ignore-gh-pages
578584

579-
# Run lint and flow checks
580-
- js_checks:
585+
# Run lint, flow, and other checks
586+
- analyze:
581587
filters: *filter-ignore-gh-pages
582588
requires:
583589
- checkout_code

Libraries/NativeAnimation/Nodes/RCTTrackingAnimatedNode.h

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,8 @@
11
/**
22
* Copyright (c) 2015-present, Facebook, Inc.
3-
* All rights reserved.
43
*
5-
* This source code is licensed under the BSD-style license found in the
6-
* LICENSE file in the root directory of this source tree. An additional grant
7-
* of patent rights can be found in the PATENTS file in the same directory.
4+
* This source code is licensed under the MIT license found in the
5+
* LICENSE file in the root directory of this source tree.
86
*/
97

108
#import "RCTAnimatedNode.h"

Libraries/NativeAnimation/Nodes/RCTTrackingAnimatedNode.m

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,8 @@
11
/**
22
* Copyright (c) 2015-present, Facebook, Inc.
3-
* All rights reserved.
43
*
5-
* This source code is licensed under the BSD-style license found in the
6-
* LICENSE file in the root directory of this source tree. An additional grant
7-
* of patent rights can be found in the PATENTS file in the same directory.
4+
* This source code is licensed under the MIT license found in the
5+
* LICENSE file in the root directory of this source tree.
86
*/
97

108
#import "RCTTrackingAnimatedNode.h"

ReactAndroid/src/main/java/com/facebook/react/animated/TrackingAnimatedNode.java

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,8 @@
11
/**
22
* Copyright (c) 2015-present, Facebook, Inc.
3-
* All rights reserved.
43
*
5-
* This source code is licensed under the BSD-style license found in the
6-
* LICENSE file in the root directory of this source tree. An additional grant
7-
* of patent rights can be found in the PATENTS file in the same directory.
4+
* This source code is licensed under the MIT license found in the
5+
* LICENSE file in the root directory of this source tree.
86
*/
97

108
package com.facebook.react.animated;

ReactAndroid/src/main/java/com/facebook/react/views/text/CustomLetterSpacingSpan.java

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,8 @@
11
/**
22
* Copyright (c) 2015-present, Facebook, Inc.
3-
* All rights reserved.
43
*
5-
* This source code is licensed under the BSD-style license found in the
6-
* LICENSE file in the root directory of this source tree. An additional grant
7-
* of patent rights can be found in the PATENTS file in the same directory.
4+
* This source code is licensed under the MIT license found in the
5+
* LICENSE file in the root directory of this source tree.
86
*/
97

108
package com.facebook.react.views.text;

ReactCommon/yoga/yoga/YGLayout.cpp

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,10 @@
11
/**
22
* Copyright (c) 2014-present, Facebook, Inc.
3-
* All rights reserved.
43
*
5-
* This source code is licensed under the BSD-style license found in the
6-
* LICENSE file in the root directory of this source tree. An additional grant
7-
* of patent rights can be found in the PATENTS file in the same directory.
4+
* This source code is licensed under the MIT license found in the
5+
* LICENSE file in the root directory of this source tree.
86
*/
7+
98
#include "YGLayout.h"
109
#include "Utils.h"
1110

ReactCommon/yoga/yoga/YGLayout.h

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,10 @@
11
/**
22
* Copyright (c) 2014-present, Facebook, Inc.
3-
* All rights reserved.
43
*
5-
* This source code is licensed under the BSD-style license found in the
6-
* LICENSE file in the root directory of this source tree. An additional grant
7-
* of patent rights can be found in the PATENTS file in the same directory.
4+
* This source code is licensed under the MIT license found in the
5+
* LICENSE file in the root directory of this source tree.
86
*/
7+
98
#pragma once
109
#include "Yoga-internal.h"
1110

ReactCommon/yoga/yoga/YGStyle.cpp

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,10 @@
11
/**
22
* Copyright (c) 2014-present, Facebook, Inc.
3-
* All rights reserved.
43
*
5-
* This source code is licensed under the BSD-style license found in the
6-
* LICENSE file in the root directory of this source tree. An additional grant
7-
* of patent rights can be found in the PATENTS file in the same directory.
4+
* This source code is licensed under the MIT license found in the
5+
* LICENSE file in the root directory of this source tree.
86
*/
7+
98
#include "YGStyle.h"
109

1110
const YGValue kYGValueUndefined = {YGUndefined, YGUnitUndefined};

ReactCommon/yoga/yoga/YGStyle.h

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,10 @@
11
/**
22
* Copyright (c) 2014-present, Facebook, Inc.
3-
* All rights reserved.
43
*
5-
* This source code is licensed under the BSD-style license found in the
6-
* LICENSE file in the root directory of this source tree. An additional grant
7-
* of patent rights can be found in the PATENTS file in the same directory.
4+
* This source code is licensed under the MIT license found in the
5+
* LICENSE file in the root directory of this source tree.
86
*/
7+
98
#pragma once
109
#include "Yoga-internal.h"
1110
#include "Yoga.h"

scripts/circleci/check_license.sh

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
#!/bin/bash
2+
3+
set -e
4+
5+
# Make sure we don't introduce accidental references to PATENTS.
6+
EXPECTED='scripts/circleci/check_license.sh'
7+
ACTUAL=$(git grep -l PATENTS)
8+
9+
if [ "$EXPECTED" != "$ACTUAL" ]; then
10+
echo "PATENTS crept into some new files?"
11+
diff -u <(echo "$EXPECTED") <(echo "$ACTUAL") || true
12+
exit 1
13+
fi

0 commit comments

Comments
 (0)