Skip to content

Commit

Permalink
Add license header fix job (jupyterlab#12872)
Browse files Browse the repository at this point in the history
* Add license header fix job

* Set header content

* Fix unsupported files

* Try pushing manually as down in galata update

* Fix getting the pull request number

* Remove fake git author

* Display commit

* Commit manually

* Add license headers

* Push only if there are changes

* Ignore staging folder

* Revert changes in staging folder

* Ignore integration test files
  • Loading branch information
fcollonval authored Aug 1, 2022
1 parent a650dd8 commit 1bcbf90
Show file tree
Hide file tree
Showing 306 changed files with 1,421 additions and 14 deletions.
52 changes: 52 additions & 0 deletions .github/workflows/license-header.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
name: Fix License Headers

on:
pull_request:

permissions:
contents: write
pull-requests: write

jobs:
header-license-fix:
runs-on: ubuntu-20.04
steps:
- name: Checkout
uses: actions/checkout@v3
with:
token: ${{ secrets.GITHUB_TOKEN }}

- name: Configure git to use https
run: git config --global hub.protocol https

- name: Checkout the branch from the PR that triggered the job
run: hub pr checkout ${{ github.event.pull_request.number }}
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

- name: Fix License Header
uses: apache/skywalking-eyes/header@v0.4.0
with:
mode: fix

- name: Get modified files in the staging directory
id: changed-files
uses: tj-actions/changed-files@v24

- name: Apply Changes
if: steps.changed-files.outputs.any_changed == 'true'
shell: bash -l {0}
run: |
git config user.name 'github-actions[bot]'
git config user.email 'github-actions[bot]@users.noreply.github.com'
git add *
git commit -m "Automatic application of license header"
- name: Push fixes
if: steps.changed-files.outputs.any_changed == 'true'
shell: bash -l {0}
run: |
git config push.default upstream
git push
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
39 changes: 39 additions & 0 deletions .licenserc.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
header:
license:
spdx-id: BSD-3-Clause
copyright-owner: Jupyter Development Team
software-name: JupyterLab
content: |
Copyright (c) Jupyter Development Team.
Distributed under the terms of the Modified BSD License.
paths-ignore:
- '**/*.ipynb'
- '**/*.json'
- '**/*.md'
- '**/*.svg'
- '**/*.yml'
- '**/*.yaml'
- '**/build'
- '**/lib'
- '**/node_modules'
- '**/MANIFEST.in'
- '**/static'
- '**/typings'
- '**/schemas'
- '**/themes'
- '*.map.js'
- '*.bundle.js'
- '**/.*'
- 'binder/postBuild'
- 'binder/start'
- 'coverage'
- 'examples/federated/example.cert'
- 'galata/test/jupyterlab/notebooks/'
- 'jupyterlab/staging'
- 'packages/extensionmanager-extension/examples/listings/settings/@jupyterlab/extensionmanager-extension/plugin.jupyterlab-settings'
- 'typedoc-theme'
- 'LICENSE'
- 'yarn.lock'

comment: on-failure
3 changes: 3 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
# Copyright (c) Jupyter Development Team.
# Distributed under the terms of the Modified BSD License.

FROM mambaorg/micromamba:0.14.0 as build

# Install basic tools
Expand Down
2 changes: 1 addition & 1 deletion LICENSE
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
Copyright (c) 2015-2021 Project Jupyter Contributors
Copyright (c) 2015-2022 Project Jupyter Contributors
All rights reserved.

Redistribution and use in source and binary forms, with or without
Expand Down
3 changes: 3 additions & 0 deletions binder/jupyter_notebook_config.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
# Copyright (c) Jupyter Development Team.
# Distributed under the terms of the Modified BSD License.

common = [
"--no-browser",
"--debug",
Expand Down
5 changes: 5 additions & 0 deletions builder/src/duplicate-package-checker-webpack-plugin.d.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
/*
* Copyright (c) Jupyter Development Team.
* Distributed under the terms of the Modified BSD License.
*/

// Type definitions for duplicate-package-checker-webpack-plugin 2.1
// Project: https://github.com/darrenscerri/duplicate-package-checker-webpack-plugin#readme
// Definitions by: Matt Traynham <https://github.com/mtraynham>
Expand Down
5 changes: 5 additions & 0 deletions builder/src/mini-css-extract-plugin.d.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
/*
* Copyright (c) Jupyter Development Team.
* Distributed under the terms of the Modified BSD License.
*/

// We use our own declaration because the existing typings do not work with webpack 5

declare module 'mini-css-extract-plugin';
5 changes: 5 additions & 0 deletions buildutils/src/local-repository.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
/*
* Copyright (c) Jupyter Development Team.
* Distributed under the terms of the Modified BSD License.
*/

/* eslint-disable camelcase */
import * as fs from 'fs-extra';
import * as child_process from 'child_process';
Expand Down
5 changes: 5 additions & 0 deletions buildutils/src/utils.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
/*
* Copyright (c) Jupyter Development Team.
* Distributed under the terms of the Modified BSD License.
*/

/* global NodeRequire */
import path from 'path';
import glob from 'glob';
Expand Down
5 changes: 5 additions & 0 deletions buildutils/src/yarnlock.d.ts
Original file line number Diff line number Diff line change
@@ -1 +1,6 @@
/*
* Copyright (c) Jupyter Development Team.
* Distributed under the terms of the Modified BSD License.
*/

declare module '@yarnpkg/lockfile';
5 changes: 5 additions & 0 deletions buildutils/template/babel.config.js
Original file line number Diff line number Diff line change
@@ -1 +1,6 @@
/*
* Copyright (c) Jupyter Development Team.
* Distributed under the terms of the Modified BSD License.
*/

module.exports = require('@jupyterlab/testutils/lib/babel.config');
5 changes: 5 additions & 0 deletions buildutils/template/jest.config.js
Original file line number Diff line number Diff line change
@@ -1,2 +1,7 @@
/*
* Copyright (c) Jupyter Development Team.
* Distributed under the terms of the Modified BSD License.
*/

const func = require('@jupyterlab/testutils/lib/jest-config');
module.exports = func(__dirname);
3 changes: 3 additions & 0 deletions clean.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
# Copyright (c) Jupyter Development Team.
# Distributed under the terms of the Modified BSD License.

import os
import subprocess

Expand Down
8 changes: 4 additions & 4 deletions dev_mode/bootstrap.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
/*-----------------------------------------------------------------------------
| Copyright (c) Jupyter Development Team.
| Distributed under the terms of the Modified BSD License.
|----------------------------------------------------------------------------*/
/*
* Copyright (c) Jupyter Development Team.
* Distributed under the terms of the Modified BSD License.
*/

// We copy some of the pageconfig parsing logic in @jupyterlab/coreutils
// below, since this must run before any other files are loaded (including
Expand Down
8 changes: 4 additions & 4 deletions dev_mode/index.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
/*-----------------------------------------------------------------------------
| Copyright (c) Jupyter Development Team.
| Distributed under the terms of the Modified BSD License.
|----------------------------------------------------------------------------*/
/*
* Copyright (c) Jupyter Development Team.
* Distributed under the terms of the Modified BSD License.
*/

import { PageConfig } from '@jupyterlab/coreutils';

Expand Down
5 changes: 5 additions & 0 deletions dev_mode/style.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
/*
* Copyright (c) Jupyter Development Team.
* Distributed under the terms of the Modified BSD License.
*/

/* This is a generated file of CSS imports */
/* It was generated by @jupyterlab/builder in Build.ensureAssets() */

Expand Down
5 changes: 5 additions & 0 deletions dev_mode/templates/403.html
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
<!--
~ Copyright (c) Jupyter Development Team.
~ Distributed under the terms of the Modified BSD License.
-->

<!DOCTYPE html>
<html>
<head>
Expand Down
5 changes: 5 additions & 0 deletions dev_mode/templates/partial.html
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
<!--
~ Copyright (c) Jupyter Development Team.
~ Distributed under the terms of the Modified BSD License.
-->

{# Copy so we do not modify the page_config with updates. #}
{% set page_config_full = page_config.copy() %}

Expand Down
5 changes: 5 additions & 0 deletions dev_mode/templates/template.html
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
<!--
~ Copyright (c) Jupyter Development Team.
~ Distributed under the terms of the Modified BSD License.
-->

<!doctype html>
<html lang="en">
<head>
Expand Down
9 changes: 4 additions & 5 deletions dev_mode/webpack.config.js
Original file line number Diff line number Diff line change
@@ -1,8 +1,7 @@
// This file is auto-generated from the corresponding file in /dev_mode
/* -----------------------------------------------------------------------------
| Copyright (c) Jupyter Development Team.
| Distributed under the terms of the Modified BSD License.
|----------------------------------------------------------------------------*/
/*
* Copyright (c) Jupyter Development Team.
* Distributed under the terms of the Modified BSD License.
*/

const path = require('path');
const fs = require('fs-extra');
Expand Down
5 changes: 5 additions & 0 deletions dev_mode/webpack.prod.config.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
/*
* Copyright (c) Jupyter Development Team.
* Distributed under the terms of the Modified BSD License.
*/

const merge = require('webpack-merge').default;
const config = require('./webpack.config');
const WPPlugin = require('@jupyterlab/builder').WPPlugin;
Expand Down
5 changes: 5 additions & 0 deletions dev_mode/webpack.prod.minimize.config.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
/*
* Copyright (c) Jupyter Development Team.
* Distributed under the terms of the Modified BSD License.
*/

const TerserPlugin = require('terser-webpack-plugin');
const merge = require('webpack-merge').default;
const WPPlugin = require('@jupyterlab/builder').WPPlugin;
Expand Down
5 changes: 5 additions & 0 deletions dev_mode/webpack.prod.release.config.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
/*
* Copyright (c) Jupyter Development Team.
* Distributed under the terms of the Modified BSD License.
*/

const merge = require('webpack-merge').default;
const config = require('./webpack.prod.minimize.config');

Expand Down
3 changes: 3 additions & 0 deletions docs/Makefile
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
# Copyright (c) Jupyter Development Team.
# Distributed under the terms of the Modified BSD License.

# Minimal makefile for Sphinx documentation
#

Expand Down
3 changes: 3 additions & 0 deletions docs/make.bat
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
rem Copyright (c) Jupyter Development Team.
rem Distributed under the terms of the Modified BSD License.

@ECHO OFF

pushd %~dp0
Expand Down
5 changes: 5 additions & 0 deletions docs/source/_static/css/custom.css
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
/*
* Copyright (c) Jupyter Development Team.
* Distributed under the terms of the Modified BSD License.
*/

/* Navbar at the top */
.jupyter-nav-logo {
padding: 0;
Expand Down
5 changes: 5 additions & 0 deletions docs/source/_templates/copyright.html
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
<!--
~ Copyright (c) Jupyter Development Team.
~ Distributed under the terms of the Modified BSD License.
-->

<div role="contentinfo">
<p>
{%- if show_copyright %}
Expand Down
3 changes: 3 additions & 0 deletions docs/source/conf.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
# Copyright (c) Jupyter Development Team.
# Distributed under the terms of the Modified BSD License.

#
# JupyterLab documentation build configuration file, created by
# sphinx-quickstart on Thu Jan 4 15:10:23 2018.
Expand Down
3 changes: 3 additions & 0 deletions docs/source/developer/api.rst
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
.. Copyright (c) Jupyter Development Team.
.. Distributed under the terms of the Modified BSD License.
JupyterLab API Reference
========================

Expand Down
3 changes: 3 additions & 0 deletions docs/source/developer/components.rst
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
.. Copyright (c) Jupyter Development Team.
.. Distributed under the terms of the Modified BSD License.
Using JupyterLab components
===========================

Expand Down
3 changes: 3 additions & 0 deletions docs/source/developer/contributing.rst
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
.. Copyright (c) Jupyter Development Team.
.. Distributed under the terms of the Modified BSD License.
Contribute
==========

Expand Down
3 changes: 3 additions & 0 deletions docs/source/developer/css.rst
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
.. Copyright (c) Jupyter Development Team.
.. Distributed under the terms of the Modified BSD License.
.. _css:

CSS Patterns
Expand Down
3 changes: 3 additions & 0 deletions docs/source/developer/internationalization.rst
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
.. Copyright (c) Jupyter Development Team.
.. Distributed under the terms of the Modified BSD License.
Internationalization and Localization
=====================================

Expand Down
3 changes: 3 additions & 0 deletions docs/source/developer/patterns.rst
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
.. Copyright (c) Jupyter Development Team.
.. Distributed under the terms of the Modified BSD License.
Design Patterns
===============

Expand Down
3 changes: 3 additions & 0 deletions docs/source/developer/repo.rst
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
.. Copyright (c) Jupyter Development Team.
.. Distributed under the terms of the Modified BSD License.
.. _developer-guide:

General Codebase Orientation
Expand Down
3 changes: 3 additions & 0 deletions docs/source/extension/documents.rst
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
.. Copyright (c) Jupyter Development Team.
.. Distributed under the terms of the Modified BSD License.
.. _documents:

Documents
Expand Down
3 changes: 3 additions & 0 deletions docs/source/extension/extension_dev.rst
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
.. Copyright (c) Jupyter Development Team.
.. Distributed under the terms of the Modified BSD License.
.. _developer_extensions:

Develop Extensions
Expand Down
3 changes: 3 additions & 0 deletions docs/source/extension/extension_migration.rst
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
.. Copyright (c) Jupyter Development Team.
.. Distributed under the terms of the Modified BSD License.
.. _extension_migration:

Extension Migration Guide
Expand Down
3 changes: 3 additions & 0 deletions docs/source/extension/extension_points.rst
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
.. Copyright (c) Jupyter Development Team.
.. Distributed under the terms of the Modified BSD License.
.. _developer-extension-points:

Common Extension Points
Expand Down
Loading

0 comments on commit 1bcbf90

Please sign in to comment.