Skip to content

Commit

Permalink
Check PATENTS does not creep into files
Browse files Browse the repository at this point in the history
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
  • Loading branch information
hramos authored and facebook-github-bot committed Mar 1, 2018
1 parent 8a7f68e commit b181b77
Show file tree
Hide file tree
Showing 10 changed files with 42 additions and 35 deletions.
12 changes: 9 additions & 3 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -152,6 +152,11 @@ aliases:
command: yarn flow check
when: always

- &run-license-checks
name: Check license
command: ./scripts/circleci/check_license.sh
when: always

- &build-android-app
name: Build Android App
command: |
Expand Down Expand Up @@ -275,14 +280,15 @@ jobs:

# Runs JavaScript lint and flow checks.
# Currently will fail a PR if lint/flow raises issues.
js_checks:
analyze:
<<: *js_defaults
steps:
- attach_workspace:
at: ~/react-native

- run: *run-lint-checks
- run: *run-flow-checks
- run: *run-license-checks

- store_test_results:
path: ~/react-native/reports/junit
Expand Down Expand Up @@ -576,8 +582,8 @@ workflows:
- checkout_code:
filters: *filter-ignore-gh-pages

# Run lint and flow checks
- js_checks:
# Run lint, flow, and other checks
- analyze:
filters: *filter-ignore-gh-pages
requires:
- checkout_code
Expand Down
6 changes: 2 additions & 4 deletions Libraries/NativeAnimation/Nodes/RCTTrackingAnimatedNode.h
Original file line number Diff line number Diff line change
@@ -1,10 +1,8 @@
/**
* Copyright (c) 2015-present, Facebook, Inc.
* All rights reserved.
*
* This source code is licensed under the BSD-style license found in the
* LICENSE file in the root directory of this source tree. An additional grant
* of patent rights can be found in the PATENTS file in the same directory.
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*/

#import "RCTAnimatedNode.h"
Expand Down
6 changes: 2 additions & 4 deletions Libraries/NativeAnimation/Nodes/RCTTrackingAnimatedNode.m
Original file line number Diff line number Diff line change
@@ -1,10 +1,8 @@
/**
* Copyright (c) 2015-present, Facebook, Inc.
* All rights reserved.
*
* This source code is licensed under the BSD-style license found in the
* LICENSE file in the root directory of this source tree. An additional grant
* of patent rights can be found in the PATENTS file in the same directory.
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*/

#import "RCTTrackingAnimatedNode.h"
Expand Down
Original file line number Diff line number Diff line change
@@ -1,10 +1,8 @@
/**
* Copyright (c) 2015-present, Facebook, Inc.
* All rights reserved.
*
* This source code is licensed under the BSD-style license found in the
* LICENSE file in the root directory of this source tree. An additional grant
* of patent rights can be found in the PATENTS file in the same directory.
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*/

package com.facebook.react.animated;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,10 +1,8 @@
/**
* Copyright (c) 2015-present, Facebook, Inc.
* All rights reserved.
*
* This source code is licensed under the BSD-style license found in the
* LICENSE file in the root directory of this source tree. An additional grant
* of patent rights can be found in the PATENTS file in the same directory.
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*/

package com.facebook.react.views.text;
Expand Down
7 changes: 3 additions & 4 deletions ReactCommon/yoga/yoga/YGLayout.cpp
Original file line number Diff line number Diff line change
@@ -1,11 +1,10 @@
/**
* Copyright (c) 2014-present, Facebook, Inc.
* All rights reserved.
*
* This source code is licensed under the BSD-style license found in the
* LICENSE file in the root directory of this source tree. An additional grant
* of patent rights can be found in the PATENTS file in the same directory.
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*/

#include "YGLayout.h"
#include "Utils.h"

Expand Down
7 changes: 3 additions & 4 deletions ReactCommon/yoga/yoga/YGLayout.h
Original file line number Diff line number Diff line change
@@ -1,11 +1,10 @@
/**
* Copyright (c) 2014-present, Facebook, Inc.
* All rights reserved.
*
* This source code is licensed under the BSD-style license found in the
* LICENSE file in the root directory of this source tree. An additional grant
* of patent rights can be found in the PATENTS file in the same directory.
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*/

#pragma once
#include "Yoga-internal.h"

Expand Down
7 changes: 3 additions & 4 deletions ReactCommon/yoga/yoga/YGStyle.cpp
Original file line number Diff line number Diff line change
@@ -1,11 +1,10 @@
/**
* Copyright (c) 2014-present, Facebook, Inc.
* All rights reserved.
*
* This source code is licensed under the BSD-style license found in the
* LICENSE file in the root directory of this source tree. An additional grant
* of patent rights can be found in the PATENTS file in the same directory.
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*/

#include "YGStyle.h"

const YGValue kYGValueUndefined = {YGUndefined, YGUnitUndefined};
Expand Down
7 changes: 3 additions & 4 deletions ReactCommon/yoga/yoga/YGStyle.h
Original file line number Diff line number Diff line change
@@ -1,11 +1,10 @@
/**
* Copyright (c) 2014-present, Facebook, Inc.
* All rights reserved.
*
* This source code is licensed under the BSD-style license found in the
* LICENSE file in the root directory of this source tree. An additional grant
* of patent rights can be found in the PATENTS file in the same directory.
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*/

#pragma once
#include "Yoga-internal.h"
#include "Yoga.h"
Expand Down
13 changes: 13 additions & 0 deletions scripts/circleci/check_license.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
#!/bin/bash

set -e

# Make sure we don't introduce accidental references to PATENTS.
EXPECTED='scripts/circleci/check_license.sh'
ACTUAL=$(git grep -l PATENTS)

if [ "$EXPECTED" != "$ACTUAL" ]; then
echo "PATENTS crept into some new files?"
diff -u <(echo "$EXPECTED") <(echo "$ACTUAL") || true
exit 1
fi

0 comments on commit b181b77

Please sign in to comment.