initial repo creation

main
Nicolas Byl 1 year ago
commit 50badd2e5a
  1. 20
      .github/workflows/pull-request.yml
  2. 23
      .pre-commit-config.yaml
  3. 1
      .python-version
  4. 12
      Makefile
  5. 12
      Pipfile
  6. 65
      README.md
  7. 28
      commercial-use/license-check-npm.yaml
  8. 18
      commercial-use/license-check-python.yaml

@ -0,0 +1,20 @@
name: lint before merge
on:
pull_request:
branches: [ main ]
jobs:
build:
runs-on: ubuntu-latest
strategy:
fail-fast: false
steps:
- uses: actions/checkout@v2
- uses: actions/setup-python@v2
with:
python-version: 3.9
- name: setup environment
run: |
pip install pipenv
make local-setup
- name: run linter
run: make lint

@ -0,0 +1,23 @@
---
repos:
- repo: https://github.com/frnmst/md-toc
rev: 7.0.2
hooks:
- id: md-toc
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v3.2.0
hooks:
- id: check-added-large-files
- id: check-builtin-literals
- id: check-case-conflict
- id: check-executables-have-shebangs
- id: check-json
- id: check-merge-conflict
- id: check-symlinks
- id: check-toml
- id: check-yaml
- id: detect-private-key
- id: double-quote-string-fixer
- id: end-of-file-fixer
- id: mixed-line-ending
- id: trailing-whitespace

@ -0,0 +1,12 @@
help: ## Show this help.
@grep -E '^[a-zA-Z_-]+:.*?## .*$$' $(MAKEFILE_LIST) | sort | awk 'BEGIN {FS = ":.*?## "}; {printf "\033[36m%-30s\033[0m %s\n", $$1, $$2}'
local-setup: ## Install local repository hooks
pipenv install -d
pipenv run pre-commit install
run-webserver: ## Run a local webserver for testing files
pipenv run python -m http.server
lint:
pipenv run pre-commit run --all-files

@ -0,0 +1,12 @@
[[source]]
url = "https://pypi.python.org/simple"
verify_ssl = true
name = "pypi"
[packages]
[dev-packages]
pre-commit = "*"
[requires]
python_version = "3.9"

@ -0,0 +1,65 @@
# license-check-configuration
<!--TOC-->
- [license-check-configuration](#license-check-configuration)
- [Overview](#overview)
- [Usage](#usage)
- [Setup pre-commit](#setup-pre-commit)
- [Setup license list](#setup-license-list)
- [Contribution](#contribution)
<!--TOC-->
## Overview
Checking the licenses of your open source dependencies is important. But the necessary collection is something, that you don't want to do again for each project. To simplify this, codecentric collects a central list of licenses that can be used for specific purposes. This list is provided as an external configuration file for the [pre-commit-license-checks](https://github.com/nbyl/pre-commit-license-checks) which can be used by [pre-commit](https://pre-commit.com/).
**This repository does not contain any legal advice which licenses can be used for which purposes. Please check the list before using it. You have been warned.**
## Usage
### Setup pre-commit
To use this make sure, you have `pre-commit` [installed](https://pre-commit.com/#install).
When setting a new project, create a new file called `.pre-commit-config.yaml` that contains at least the following hooks:
```
---
repos:
- repo: https://github.com/nbyl/pre-commit-license-checks
rev: v1.3.1
hooks:
- id: license-check-npm
- id: license-check-pipenv
```
Afterwards, you can setup your local git hooks using:
```
pre-commit install
```
From now on, alle your git commits will be checked locally with the configured hooks.
### Setup license list
To use the external license list, create a file `.license-check.yaml` next to your package manager file:
```
---
include:
- url: https://raw.githubusercontent.com/nbyl/license-check-config/main/commercial-use/$FILE
```
Replace `$FILE` with the file for your supported package manager according to this table:
| Package Manager | Package Manager File | $FILE |
| --------------- | -------------------- | --------------------------- |
| npm | `package.json` | `license-check-npm.yaml` |
| pipenv | `Pipfile` | `license-check-python.yaml` |
## Contribution
If you want to update the list of allowed license, please edit the corresponding configuration file and submit a pull request.

@ -0,0 +1,28 @@
---
allowedLicenses:
- (BSD-3-Clause OR GPL-2.0)
- (CC-BY-4.0 AND OFL-1.1 AND MIT)
- (MIT AND BSD-3-Clause)
- (MIT AND CC-BY-3.0)
- (MIT AND Zlib)
- (MIT OR Apache-2.0)
- (MIT OR CC0-1.0)
- (WTFPL OR MIT)
- (BSD-2-Clause OR MIT OR Apache-2.0)
- 0BSD
- AFLv2.1,BSD
- Apache*
- Apache-2.0
- BSD*
- BSD-2-Clause
- BSD-3-Clause
- CC-BY-3.0
- CC-BY-4.0
- CC0-1.0
- ISC
- MIT
- MIT*
- Python-2.0
- Unlicense
- WTFPL
- WTFPL OR ISC

@ -0,0 +1,18 @@
---
allowedLicenses:
- 3-Clause BSD License
- Apache 2.0
- Apache-2.0
- Apache Software License
- Apache Software License, BSD License
- Apache Software License, MIT License
- BSD
- BSD License
- BSD License, Apache Software License
- CC0 1.0 Universal (CC0 1.0) Public Domain Dedication
- ISC License (ISCL)
- MIT
- MIT License
- Mozilla Public License 2.0 (MPL 2.0)
- Public Domain
- Python Software Foundation License