Skip to content

Commit

Permalink
Add license-header action (#4)
Browse files Browse the repository at this point in the history
* Add license-header action

* DO not merge

* Automatic application of license header

* remove useless change

---------

Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
  • Loading branch information
brichet and github-actions[bot] authored Mar 28, 2024
1 parent 5fb26ad commit 65154a6
Show file tree
Hide file tree
Showing 53 changed files with 315 additions and 5 deletions.
62 changes: 62 additions & 0 deletions .github/workflows/license-header.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,62 @@
name: Fix License Headers

on:
pull_request_target:

jobs:
header-license-fix:
runs-on: ubuntu-latest

permissions:
contents: write
pull-requests: write

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: gh pr checkout ${{ github.event.pull_request.number }}
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

- name: Fix License Header
uses: apache/skywalking-eyes/[email protected]
with:
mode: fix

- name: List files changed
id: files-changed
shell: bash -l {0}
run: |
set -ex
export CHANGES=$(git status --porcelain | tee modified.log | wc -l)
cat modified.log
# Remove the log otherwise it will be committed
rm modified.log
echo "N_CHANGES=${CHANGES}" >> $GITHUB_OUTPUT
git diff
- name: Commit any changes
if: steps.files-changed.outputs.N_CHANGES != '0'
shell: bash -l {0}
run: |
git config user.name "github-actions[bot]"
git config user.email "github-actions[bot]@users.noreply.github.com"
git pull --no-tags
git add *
git commit -m "Automatic application of license header"
git config push.default upstream
git push
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
28 changes: 28 additions & 0 deletions .licenserc.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
header:
license:
spdx-id: BSD-3-Clause
copyright-owner: Jupyter Development Team
software-name: Jupyter-chat
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'
- '*.map.js'
- '*.bundle.js'
- '**/.*'
- 'binder/postBuild'
- 'coverage'
- 'LICENSE'
- 'yarn.lock'

comment: on-failure
3 changes: 3 additions & 0 deletions conftest.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 pytest

pytest_plugins = ("pytest_jupyter.jupyter_server", )
5 changes: 5 additions & 0 deletions packages/jupyter-chat-extension/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 packages/jupyter-chat-extension/jest.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 jestJupyterLab = require('@jupyterlab/testutils/lib/jest-config');

const esModules = [
Expand Down
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.

try:
from ._version import __version__
except ImportError:
Expand Down
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 json
import logging
import os
Expand Down
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 jupyter_server.extension.application import ExtensionApp

from .config_manager import ConfigManager
Expand Down
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 getpass
import json
import time
Expand Down
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 typing import Any, Dict, List, Literal, Optional, Union

from langchain.pydantic_v1 import BaseModel, validator
Expand Down
Original file line number Diff line number Diff line change
@@ -1 +1,4 @@
# Copyright (c) Jupyter Development Team.
# Distributed under the terms of the Modified BSD License.

"""Python unit tests for jupyter_chat."""
Original file line number Diff line number Diff line change
@@ -1 +1,4 @@
# Copyright (c) Jupyter Development Team.
# Distributed under the terms of the Modified BSD License.

### TODO ####
3 changes: 3 additions & 0 deletions packages/jupyter-chat-extension/pyproject.toml
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.

[build-system]
requires = ["hatchling>=1.5.0", "jupyterlab>=4.0.0,<5", "hatch-nodejs-version>=0.3.2"]
build-backend = "hatchling.build"
Expand Down
3 changes: 3 additions & 0 deletions packages/jupyter-chat-extension/setup.py
Original file line number Diff line number Diff line change
@@ -1 +1,4 @@
# Copyright (c) Jupyter Development Team.
# Distributed under the terms of the Modified BSD License.

__import__("setuptools").setup()
5 changes: 5 additions & 0 deletions packages/jupyter-chat-extension/src/handlers/handler.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.
*/

import { URLExt } from '@jupyterlab/coreutils';
import { ServerConnection } from '@jupyterlab/services';

Expand Down
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.
*/

import { URLExt } from '@jupyterlab/coreutils';
import { ServerConnection } from '@jupyterlab/services';
import { UUID } from '@lumino/coreutils';
Expand Down
8 changes: 3 additions & 5 deletions packages/jupyter-chat-extension/src/index.ts
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
// Copyright (c) Jupyter Development Team.
// Distributed under the terms of the Modified BSD License.
/**
* @packageDocumentation
* @module chat-extension
/*
* Copyright (c) Jupyter Development Team.
* Distributed under the terms of the Modified BSD License.
*/

import {
Expand Down
5 changes: 5 additions & 0 deletions packages/jupyter-chat-extension/style/base.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.
*/

/*
See the JupyterLab Developer Guide for useful CSS Patterns:
Expand Down
5 changes: 5 additions & 0 deletions packages/jupyter-chat-extension/style/index.css
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.
*/

@import url('base.css');
5 changes: 5 additions & 0 deletions packages/jupyter-chat-extension/style/index.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.
*/

import './base.css';
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.

"""Server configuration for integration tests.
!! Never use this configuration in production because it
Expand Down
5 changes: 5 additions & 0 deletions packages/jupyter-chat-extension/ui-tests/playwright.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.
*/

/**
* Configuration for Playwright using default from @jupyterlab/galata
*/
Expand Down
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.
*/

import { expect, test } from '@jupyterlab/galata';

/**
Expand Down
5 changes: 5 additions & 0 deletions packages/jupyter-chat/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 packages/jupyter-chat/jest.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 jestJupyterLab = require('@jupyterlab/testutils/lib/jest-config');

const esModules = [
Expand Down
5 changes: 5 additions & 0 deletions packages/jupyter-chat/src/__tests__/model.spec.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.
*/

/**
* Example of [Jest](https://jestjs.io/docs/getting-started) unit tests
*/
Expand Down
5 changes: 5 additions & 0 deletions packages/jupyter-chat/src/__tests__/widgets.spec.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.
*/

/**
* Example of [Jest](https://jestjs.io/docs/getting-started) unit tests
*/
Expand Down
5 changes: 5 additions & 0 deletions packages/jupyter-chat/src/components/chat-input.tsx
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.
*/

import React from 'react';

import {
Expand Down
5 changes: 5 additions & 0 deletions packages/jupyter-chat/src/components/chat-messages.tsx
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.
*/

import { IRenderMimeRegistry } from '@jupyterlab/rendermime';
import { Avatar, Box, Typography } from '@mui/material';
import type { SxProps, Theme } from '@mui/material';
Expand Down
5 changes: 5 additions & 0 deletions packages/jupyter-chat/src/components/chat.tsx
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.
*/

import { IRenderMimeRegistry } from '@jupyterlab/rendermime';
import ArrowBackIcon from '@mui/icons-material/ArrowBack';
import SettingsIcon from '@mui/icons-material/Settings';
Expand Down
5 changes: 5 additions & 0 deletions packages/jupyter-chat/src/components/copy-button.tsx
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.
*/

import React, { useState, useCallback } from 'react';

import { Box, Button } from '@mui/material';
Expand Down
5 changes: 5 additions & 0 deletions packages/jupyter-chat/src/components/jl-theme-provider.tsx
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.
*/

import React, { useState, useEffect } from 'react';
import type { IThemeManager } from '@jupyterlab/apputils';
import { Theme, ThemeProvider, createTheme } from '@mui/material/styles';
Expand Down
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.
*/

import React, { useState, useMemo, useCallback } from 'react';
import { Alert, AlertColor, Collapse } from '@mui/material';

Expand Down
5 changes: 5 additions & 0 deletions packages/jupyter-chat/src/components/rendermime-markdown.tsx
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.
*/

import React, { useState, useEffect, useRef } from 'react';
import ReactDOM from 'react-dom';

Expand Down
5 changes: 5 additions & 0 deletions packages/jupyter-chat/src/components/scroll-container.tsx
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.
*/

import React, { useEffect, useMemo } from 'react';
import { Box, SxProps, Theme } from '@mui/material';

Expand Down
5 changes: 5 additions & 0 deletions packages/jupyter-chat/src/icons.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.
*/

// This file is based on iconimports.ts in @jupyterlab/ui-components, but is manually generated.

import { LabIcon } from '@jupyterlab/ui-components';
Expand Down
5 changes: 5 additions & 0 deletions packages/jupyter-chat/src/index.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.
*/

export * from './icons';
export * from './model';
export * from './types';
Expand Down
5 changes: 5 additions & 0 deletions packages/jupyter-chat/src/model.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.
*/

import { IDisposable } from '@lumino/disposable';
import { ISignal, Signal } from '@lumino/signaling';

Expand Down
5 changes: 5 additions & 0 deletions packages/jupyter-chat/src/theme-provider.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.
*/

import { Theme, createTheme } from '@mui/material/styles';

function getCSSVariable(name: string): string {
Expand Down
Loading

0 comments on commit 65154a6

Please sign in to comment.