Skip to content

Add fmt:license and check:license tasks#31

Merged
dahlia merged 4 commits into
fedify-dev:mainfrom
2chanhaeng:main
Jul 22, 2026
Merged

Add fmt:license and check:license tasks#31
dahlia merged 4 commits into
fedify-dev:mainfrom
2chanhaeng:main

Conversation

@2chanhaeng

@2chanhaeng 2chanhaeng commented Jul 22, 2026

Copy link
Copy Markdown
Member

Adds the check:license task; this task checks for files with missing licenses.
Also adds the fmt:license task; this task adds license comments to files missing them.
check depends on check:license, and fmt depends on fmt:license. Therefore, license checks and formatting are automatically applied to all files within the workflow.

Assisted by Claude Code:claude-sonnet-5 and remain the prompt in the message of eee5695.

Prompt:
"""
현재 코드 베이스는 GPL 3.0 하에 배포되기 때문에 모든 소스 코드 파일이 GPL 주석으로 시작되어야 합니다.
이를 검사하고 자동으로 채워넣어주는 `addLicense` 를 완성하세요.
1. `INCLUDED` 에 포함되는 모든 파일을 찾습니다.
2. `GPL` 의 키를 확장자로 가진 파일만 추려냅니다.
3. `EXCLUDED` 에 포함되는 파일은 걸러냅니다.
4. 파일에서 `GPL[ext]`의 줄만큼 읽습니다. (CSS 의 경우 17줄, 그외에는 15줄)
5. 해당 내용이 `GPL[ext]` 와 동일하지 않은 파일을 추려냅니다.
6-1. 그런 파일이 없다면 exit 0 로 종료합니다.
6-2. 하나의 파일이라도 문제가 있는 경우 다음을 진행합니다.
7-1. `check === true` 인 경우 문제가 있는 파일들의 목록을 출력한 뒤 exit 1 로 종료합니다.
7-2. 아닐 경우 해당하는 파일들의 서두에 `GPL[ext]` 를 추가합니다.
"""
Output: changes in this commit

Assisted-by: Claude Code:claude-sonnet-5
@2chanhaeng
2chanhaeng requested review from dahlia, dodok8 and sij411 July 22, 2026 13:32
@dahlia dahlia added the enhancement New feature or request label Jul 22, 2026
@dahlia dahlia added this to the DrFed 0.1.0 milestone Jul 22, 2026
@dahlia
dahlia merged commit d7baacf into fedify-dev:main Jul 22, 2026
4 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants