Skip to content

Commit 8f63178

Browse files
committed
📄 Automatic license header check w/ copywrite
1 parent bfaed36 commit 8f63178

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

49 files changed

+176
-0
lines changed

.copywrite.hcl

+16
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
schema_version = 1
2+
3+
project {
4+
license = "MIT"
5+
copyright_year = 2024
6+
copyright_holder = "NiceBots"
7+
header_ignore = [
8+
".venv/**",
9+
"logs/**",
10+
".idea/**",
11+
".git/**",
12+
".vscode/**",
13+
"__pycache__/**",
14+
"*.pyc",
15+
]
16+
}

.github/workflows/license.yaml

+19
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
name: Check for LICENSE file header
2+
3+
on:
4+
push:
5+
branches:
6+
- main
7+
- dev
8+
pull_request:
9+
10+
jobs:
11+
check-license-header:
12+
runs-on: ubuntu-latest
13+
steps:
14+
- name: Checkout repository
15+
uses: actions/checkout@v4
16+
- name: Setup Copywrite
17+
uses: hashicorp/setup-copywrite@867a1a2a064a0626db322392806428f7dc59cb3e
18+
- name: Check Header Compliance
19+
run: copywrite headers --plan --config .copywrite.hcl

Dockerfile

+3
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,6 @@
1+
# Copyright (c) NiceBots.xyz
2+
# SPDX-License-Identifier: MIT
3+
14
# For more information, please refer to https://aka.ms/vscode-docker-python
25
FROM python:3.12-slim-bookworm
36

config.example.yaml

+3
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,6 @@
1+
# Copyright (c) NiceBots.xyz
2+
# SPDX-License-Identifier: MIT
3+
14
#file: noinspection SpellCheckingInspection
25
extensions:
36
topgg: # If your discord bot is on top.gg, you can enable this extension to post your stats (server count, shard count, etc.) on top.gg automatically.

scripts/__init__.py

+3
Original file line numberDiff line numberDiff line change
@@ -1 +1,4 @@
1+
# Copyright (c) NiceBots.xyz
2+
# SPDX-License-Identifier: MIT
3+
14
from . import check_listings

scripts/check_listings/__init__.py

+3
Original file line numberDiff line numberDiff line change
@@ -1 +1,4 @@
1+
# Copyright (c) NiceBots.xyz
2+
# SPDX-License-Identifier: MIT
3+
14
from .__main__ import main

scripts/check_listings/__main__.py

+3
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,6 @@
1+
# Copyright (c) NiceBots.xyz
2+
# SPDX-License-Identifier: MIT
3+
14
import asyncio
25
import nodriver as uc
36
import markdown

scripts/check_listings/listings/DiscordAppDirectory.py

+3
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,6 @@
1+
# Copyright (c) NiceBots.xyz
2+
# SPDX-License-Identifier: MIT
3+
14
import nodriver as uc
25

36
from bs4 import BeautifulSoup

scripts/check_listings/listings/DiscordBotListCom.py

+3
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,6 @@
1+
# Copyright (c) NiceBots.xyz
2+
# SPDX-License-Identifier: MIT
3+
14
import nodriver as uc
25
import asyncio
36

scripts/check_listings/listings/DiscordBotsGg.py

+3
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,6 @@
1+
# Copyright (c) NiceBots.xyz
2+
# SPDX-License-Identifier: MIT
3+
14
import nodriver as uc
25

36
from bs4 import BeautifulSoup

scripts/check_listings/listings/DiscordMe.py

+3
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,6 @@
1+
# Copyright (c) NiceBots.xyz
2+
# SPDX-License-Identifier: MIT
3+
14
import nodriver as uc
25
import asyncio
36

scripts/check_listings/listings/DiscordsCom.py

+3
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,6 @@
1+
# Copyright (c) NiceBots.xyz
2+
# SPDX-License-Identifier: MIT
3+
14
import nodriver as uc
25

36
from bs4 import BeautifulSoup

scripts/check_listings/listings/DisforgeCom.py

+3
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,6 @@
1+
# Copyright (c) NiceBots.xyz
2+
# SPDX-License-Identifier: MIT
3+
14
import nodriver as uc
25

36
from bs4 import BeautifulSoup

scripts/check_listings/listings/Listing.py

+3
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,6 @@
1+
# Copyright (c) NiceBots.xyz
2+
# SPDX-License-Identifier: MIT
3+
14
import nodriver as uc
25

36
from abc import ABC, abstractmethod

scripts/check_listings/listings/TopGg.py

+3
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,6 @@
1+
# Copyright (c) NiceBots.xyz
2+
# SPDX-License-Identifier: MIT
3+
14
import nodriver as uc
25

36
from bs4 import BeautifulSoup

scripts/check_listings/listings/WumpusStore.py

+3
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,6 @@
1+
# Copyright (c) NiceBots.xyz
2+
# SPDX-License-Identifier: MIT
3+
14
import nodriver as uc
25

36
from bs4 import BeautifulSoup

scripts/check_listings/main.py

+3
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,6 @@
1+
# Copyright (c) NiceBots.xyz
2+
# SPDX-License-Identifier: MIT
3+
14
import asyncio
25
import nodriver as uc
36
import markdown

src/__main__.py

+3
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,6 @@
1+
# Copyright (c) NiceBots.xyz
2+
# SPDX-License-Identifier: MIT
3+
14
import sys
25
import os
36

src/config/__init__.py

+3
Original file line numberDiff line numberDiff line change
@@ -1 +1,4 @@
1+
# Copyright (c) NiceBots.xyz
2+
# SPDX-License-Identifier: MIT
3+
14
from .bot_config import *

src/config/bot_config.py

+3
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,6 @@
1+
# Copyright (c) NiceBots.xyz
2+
# SPDX-License-Identifier: MIT
3+
14
import yaml
25
import os
36
import orjson

src/custom/__init__.py

+3
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,6 @@
1+
# Copyright (c) NiceBots.xyz
2+
# SPDX-License-Identifier: MIT
3+
14
from typing_extensions import override
25
import discord
36
from src.i18n import apply_locale

src/extensions/add-dm/__init__.py

+3
Original file line numberDiff line numberDiff line change
@@ -1 +1,4 @@
1+
# Copyright (c) NiceBots.xyz
2+
# SPDX-License-Identifier: MIT
3+
14
from .main import setup, default, schema

src/extensions/add-dm/main.py

+3
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,6 @@
1+
# Copyright (c) NiceBots.xyz
2+
# SPDX-License-Identifier: MIT
3+
14
import discord
25

36
from discord.ext import commands

src/extensions/branding/__init__.py

+3
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,6 @@
1+
# Copyright (c) NiceBots.xyz
2+
# SPDX-License-Identifier: MIT
3+
14
from .branding import *
25

36
__all__ = ["setup", "default", "schema"]

src/extensions/branding/branding.py

+3
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,6 @@
1+
# Copyright (c) NiceBots.xyz
2+
# SPDX-License-Identifier: MIT
3+
14
import logging
25
import discord
36
import pytz

src/extensions/listings/__init__.py

+3
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,6 @@
1+
# Copyright (c) NiceBots.xyz
2+
# SPDX-License-Identifier: MIT
3+
14
from .main import *
25

36
__all__ = ["setup", "default", "schema"]

src/extensions/listings/main.py

+3
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,6 @@
1+
# Copyright (c) NiceBots.xyz
2+
# SPDX-License-Identifier: MIT
3+
14
import discord
25
import aiohttp
36

+3
Original file line numberDiff line numberDiff line change
@@ -1 +1,4 @@
1+
# Copyright (c) NiceBots.xyz
2+
# SPDX-License-Identifier: MIT
3+
14
from .main import setup, default, schema

src/extensions/nice-errors/handler.py

+3
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,6 @@
1+
# Copyright (c) NiceBots.xyz
2+
# SPDX-License-Identifier: MIT
3+
14
import discord
25

36
sentry_sdk = None

src/extensions/nice-errors/main.py

+3
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,6 @@
1+
# Copyright (c) NiceBots.xyz
2+
# SPDX-License-Identifier: MIT
3+
14
import discord
25

36
from discord.ext import commands

src/extensions/nice-errors/patch.py

+3
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,6 @@
1+
# Copyright (c) NiceBots.xyz
2+
# SPDX-License-Identifier: MIT
3+
14
from typing import Any
25
from .handler import handle_error
36

src/extensions/ping/__init__.py

+3
Original file line numberDiff line numberDiff line change
@@ -1 +1,4 @@
1+
# Copyright (c) NiceBots.xyz
2+
# SPDX-License-Identifier: MIT
3+
14
from .ping import setup, setup_webserver, on_startup, default, schema

src/extensions/ping/ping.py

+3
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,6 @@
1+
# Copyright (c) NiceBots.xyz
2+
# SPDX-License-Identifier: MIT
3+
14
import discord
25
import aiohttp
36

src/extensions/ping/translations.yml

+3
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,6 @@
1+
# Copyright (c) NiceBots.xyz
2+
# SPDX-License-Identifier: MIT
3+
14
commands:
25
ping:
36
name:
+3
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,6 @@
1+
# Copyright (c) NiceBots.xyz
2+
# SPDX-License-Identifier: MIT
3+
14
from .main import setup, default, schema
25

36
__all__ = ["setup", "default", "schema"]

src/extensions/status-post/main.py

+3
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,6 @@
1+
# Copyright (c) NiceBots.xyz
2+
# SPDX-License-Identifier: MIT
3+
14
import discord
25
import aiohttp
36

src/i18n/__init__.py

+3
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,6 @@
1+
# Copyright (c) NiceBots.xyz
2+
# SPDX-License-Identifier: MIT
3+
14
from .utils import apply, load_translation
25
from .classes import apply_locale
36

src/i18n/classes.py

+3
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,6 @@
1+
# Copyright (c) NiceBots.xyz
2+
# SPDX-License-Identifier: MIT
3+
14
from typing import Any
25
from typing_extensions import override
36
from pydantic import BaseModel, Field

src/i18n/utils.py

+3
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,6 @@
1+
# Copyright (c) NiceBots.xyz
2+
# SPDX-License-Identifier: MIT
3+
14
from typing import TypeVar
25
import discord
36
from .classes import (

src/log/__init__.py

+3
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,6 @@
1+
# Copyright (c) NiceBots.xyz
2+
# SPDX-License-Identifier: MIT
3+
14
from .logger import logger, patch
25

36
__all__ = ["logger", "patch"]

src/log/logger.py

+3
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,6 @@
1+
# Copyright (c) NiceBots.xyz
2+
# SPDX-License-Identifier: MIT
3+
14
import logging
25
import os
36
import time

src/start.py

+3
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,6 @@
1+
# Copyright (c) NiceBots.xyz
2+
# SPDX-License-Identifier: MIT
3+
14
import discord
25
import importlib
36
import importlib.util

src/utils/__init__.py

+3
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,6 @@
1+
# Copyright (c) NiceBots.xyz
2+
# SPDX-License-Identifier: MIT
3+
14
from .extensions import validate_module, unzip_extensions
25
from .misc import mention_command
36
from .setup_func import setup_func

src/utils/extensions.py

+3
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,6 @@
1+
# Copyright (c) NiceBots.xyz
2+
# SPDX-License-Identifier: MIT
3+
14
import inspect
25
import os
36
import zipfile

src/utils/iterator.py

+3
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,6 @@
1+
# Copyright (c) NiceBots.xyz
2+
# SPDX-License-Identifier: MIT
3+
14
from typing import TypeVar
25
from collections.abc import Iterator
36

src/utils/misc.py

+3
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,6 @@
1+
# Copyright (c) NiceBots.xyz
2+
# SPDX-License-Identifier: MIT
3+
14
import discord
25

36

src/utils/setup_func.py

+3
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,6 @@
1+
# Copyright (c) NiceBots.xyz
2+
# SPDX-License-Identifier: MIT
3+
14
from inspect import signature
25
from typing import Any, Callable
36

tests/__init__.py

+3
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
# Copyright (c) NiceBots.xyz
2+
# SPDX-License-Identifier: MIT
3+

tests/schema_test.py

+3
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,6 @@
1+
# Copyright (c) NiceBots.xyz
2+
# SPDX-License-Identifier: MIT
3+
14
from glob import iglob
25
from os.path import splitext, basename
36
import importlib

0 commit comments

Comments
 (0)