slopdam 0.2.0__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- slopdam-0.2.0/.github/ISSUE_TEMPLATE/config.yml +8 -0
- slopdam-0.2.0/.github/ISSUE_TEMPLATE/false-positive.yml +32 -0
- slopdam-0.2.0/.github/ISSUE_TEMPLATE/rule-request.yml +18 -0
- slopdam-0.2.0/.github/PULL_REQUEST_TEMPLATE.md +10 -0
- slopdam-0.2.0/.github/dependabot.yml +10 -0
- slopdam-0.2.0/.github/workflows/ci.yml +40 -0
- slopdam-0.2.0/.github/workflows/release.yml +40 -0
- slopdam-0.2.0/.gitignore +14 -0
- slopdam-0.2.0/.pre-commit-hooks.yaml +6 -0
- slopdam-0.2.0/CHANGELOG.md +32 -0
- slopdam-0.2.0/CODE_OF_CONDUCT.ko.md +15 -0
- slopdam-0.2.0/CODE_OF_CONDUCT.md +15 -0
- slopdam-0.2.0/CONTRIBUTING.ko.md +65 -0
- slopdam-0.2.0/CONTRIBUTING.md +65 -0
- slopdam-0.2.0/GOVERNANCE.ko.md +45 -0
- slopdam-0.2.0/GOVERNANCE.md +45 -0
- slopdam-0.2.0/LICENSE +21 -0
- slopdam-0.2.0/PKG-INFO +140 -0
- slopdam-0.2.0/README.ko.md +118 -0
- slopdam-0.2.0/README.md +118 -0
- slopdam-0.2.0/SECURITY.ko.md +27 -0
- slopdam-0.2.0/SECURITY.md +27 -0
- slopdam-0.2.0/THIRD_PARTY_NOTICES.md +25 -0
- slopdam-0.2.0/docs/RULES.ko.md +61 -0
- slopdam-0.2.0/docs/RULES.md +61 -0
- slopdam-0.2.0/pyproject.toml +34 -0
- slopdam-0.2.0/src/slopdam/__init__.py +10 -0
- slopdam-0.2.0/src/slopdam/cli.py +204 -0
- slopdam-0.2.0/src/slopdam/config.py +242 -0
- slopdam-0.2.0/src/slopdam/fixer.py +266 -0
- slopdam-0.2.0/src/slopdam/rules.py +281 -0
- slopdam-0.2.0/src/slopdam/stdlib.py +51 -0
- slopdam-0.2.0/tests/test_fix_config.py +201 -0
- slopdam-0.2.0/tests/test_rules.py +261 -0
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
blank_issues_enabled: true
|
|
2
|
+
contact_links:
|
|
3
|
+
- name: Report a security vulnerability
|
|
4
|
+
url: https://github.com/slopdam/slopdam/security/advisories/new
|
|
5
|
+
about: Please report privately instead of opening a public issue
|
|
6
|
+
- name: Questions and ideas
|
|
7
|
+
url: https://github.com/slopdam/slopdam/discussions
|
|
8
|
+
about: Ask usage questions in Discussions
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
name: Wrong change (false positive)
|
|
2
|
+
description: slopdam changed text it should have left alone
|
|
3
|
+
labels: [false-positive]
|
|
4
|
+
body:
|
|
5
|
+
- type: input
|
|
6
|
+
id: input
|
|
7
|
+
attributes:
|
|
8
|
+
label: Input
|
|
9
|
+
validations:
|
|
10
|
+
required: true
|
|
11
|
+
- type: input
|
|
12
|
+
id: output
|
|
13
|
+
attributes:
|
|
14
|
+
label: Actual output
|
|
15
|
+
validations:
|
|
16
|
+
required: true
|
|
17
|
+
- type: input
|
|
18
|
+
id: expected
|
|
19
|
+
attributes:
|
|
20
|
+
label: Expected output
|
|
21
|
+
validations:
|
|
22
|
+
required: true
|
|
23
|
+
- type: dropdown
|
|
24
|
+
id: profile
|
|
25
|
+
attributes:
|
|
26
|
+
label: Profile
|
|
27
|
+
options: [reader (default), dev]
|
|
28
|
+
- type: input
|
|
29
|
+
id: version
|
|
30
|
+
attributes:
|
|
31
|
+
label: slopdam version
|
|
32
|
+
placeholder: python -c "import slopdam; print(slopdam.__version__)"
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
name: Rule request
|
|
2
|
+
description: Suggest a trace slopdam should catch
|
|
3
|
+
labels: [rule-request]
|
|
4
|
+
body:
|
|
5
|
+
- type: textarea
|
|
6
|
+
id: examples
|
|
7
|
+
attributes:
|
|
8
|
+
label: Text that should be caught (real AI output is best)
|
|
9
|
+
validations:
|
|
10
|
+
required: true
|
|
11
|
+
- type: textarea
|
|
12
|
+
id: preserve
|
|
13
|
+
attributes:
|
|
14
|
+
label: Similar text that must not be caught
|
|
15
|
+
- type: textarea
|
|
16
|
+
id: expected
|
|
17
|
+
attributes:
|
|
18
|
+
label: Expected output (reader and dev)
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
## What does this change?
|
|
2
|
+
|
|
3
|
+
## Checklist
|
|
4
|
+
|
|
5
|
+
- [ ] Every commit is signed off (`git commit -s`)
|
|
6
|
+
- [ ] Tests added or updated, and `python -m pytest` passes
|
|
7
|
+
- [ ] If output changes: `[output-change]` in the title, and a before and after example in CHANGELOG under "Output changes"
|
|
8
|
+
- [ ] If this is a new rule: inputs that must and must not match, expected `reader` and `dev` output, level, and an idempotency case (see CONTRIBUTING)
|
|
9
|
+
- [ ] No nested quantifiers in new regular expressions (ReDoS)
|
|
10
|
+
- [ ] If a document with a Korean version (`*.ko.md`) changed, it is updated too or the description says a translation is needed
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
name: ci
|
|
2
|
+
|
|
3
|
+
on:
|
|
4
|
+
push:
|
|
5
|
+
branches: [main]
|
|
6
|
+
pull_request:
|
|
7
|
+
|
|
8
|
+
permissions:
|
|
9
|
+
contents: read
|
|
10
|
+
|
|
11
|
+
jobs:
|
|
12
|
+
test:
|
|
13
|
+
runs-on: ${{ matrix.os }}
|
|
14
|
+
strategy:
|
|
15
|
+
fail-fast: false
|
|
16
|
+
matrix:
|
|
17
|
+
python: ["3.10", "3.11", "3.12", "3.13"]
|
|
18
|
+
os: [ubuntu-latest]
|
|
19
|
+
include:
|
|
20
|
+
# ubuntu-latest (26.04) no longer ships 3.9, but macOS's system python3 is still 3.9.
|
|
21
|
+
- python: "3.9"
|
|
22
|
+
os: ubuntu-24.04
|
|
23
|
+
steps:
|
|
24
|
+
- uses: actions/checkout@v7
|
|
25
|
+
- uses: actions/setup-python@v7
|
|
26
|
+
with:
|
|
27
|
+
python-version: ${{ matrix.python }}
|
|
28
|
+
- run: pip install -e . pytest
|
|
29
|
+
- run: python -m pytest -q
|
|
30
|
+
|
|
31
|
+
dogfood:
|
|
32
|
+
# The project's own log strings must pass its own linter.
|
|
33
|
+
runs-on: ubuntu-latest
|
|
34
|
+
steps:
|
|
35
|
+
- uses: actions/checkout@v7
|
|
36
|
+
- uses: actions/setup-python@v7
|
|
37
|
+
with:
|
|
38
|
+
python-version: "3.12"
|
|
39
|
+
- run: pip install -e .
|
|
40
|
+
- run: slopdam check src/
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
name: release
|
|
2
|
+
|
|
3
|
+
# Push a tag like v0.2.0 to publish to PyPI.
|
|
4
|
+
# Uses PyPI Trusted Publishing: no API token is stored in the repository.
|
|
5
|
+
# One-time setup: add a pending publisher on pypi.org (owner slopdam, repo slopdam,
|
|
6
|
+
# workflow release.yml, environment pypi). See https://docs.pypi.org/trusted-publishers/
|
|
7
|
+
|
|
8
|
+
on:
|
|
9
|
+
push:
|
|
10
|
+
tags: ["v*"]
|
|
11
|
+
|
|
12
|
+
jobs:
|
|
13
|
+
build:
|
|
14
|
+
runs-on: ubuntu-latest
|
|
15
|
+
permissions:
|
|
16
|
+
contents: read
|
|
17
|
+
steps:
|
|
18
|
+
- uses: actions/checkout@v7
|
|
19
|
+
- uses: actions/setup-python@v7
|
|
20
|
+
with:
|
|
21
|
+
python-version: "3.12"
|
|
22
|
+
- run: pip install build
|
|
23
|
+
- run: python -m build
|
|
24
|
+
- uses: actions/upload-artifact@v7
|
|
25
|
+
with:
|
|
26
|
+
name: dist
|
|
27
|
+
path: dist/
|
|
28
|
+
|
|
29
|
+
publish:
|
|
30
|
+
needs: build
|
|
31
|
+
runs-on: ubuntu-latest
|
|
32
|
+
environment: pypi
|
|
33
|
+
permissions:
|
|
34
|
+
id-token: write
|
|
35
|
+
steps:
|
|
36
|
+
- uses: actions/download-artifact@v8
|
|
37
|
+
with:
|
|
38
|
+
name: dist
|
|
39
|
+
path: dist/
|
|
40
|
+
- uses: pypa/gh-action-pypi-publish@release/v1
|
slopdam-0.2.0/.gitignore
ADDED
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
# Changelog
|
|
2
|
+
|
|
3
|
+
The format follows [Keep a Changelog](https://keepachangelog.com/en/1.1.0/). Versioning follows the output stability policy in [GOVERNANCE.md](GOVERNANCE.md).
|
|
4
|
+
|
|
5
|
+
## [0.2.0] - 2026-11-23
|
|
6
|
+
|
|
7
|
+
### Added
|
|
8
|
+
- `reader` (default) and `dev` profiles, and `basic`, `strong` and `strict` levels.
|
|
9
|
+
- Context-aware handling of 25 dash-like characters, including the Hangul `ㅡ` (U+3161, U+FFDA, U+1173).
|
|
10
|
+
- Protected spans: URLs, inline code, `key=value` values and paths.
|
|
11
|
+
- `dev` status tags (`[OK]`, `[FAIL]`, `[WARN]`), omitted when the log level already says the same thing.
|
|
12
|
+
- Rule IDs, disabling by ID or group, `# slopdam: ignore[...]`, `check --format json`, `--dash-inline`.
|
|
13
|
+
- `slopdam fix`: rewrites string arguments of log and print calls in Python files (or every string with `--scope strings`) using the syntax tree. Keeps quotes, prefixes, escapes, f-string expressions and placeholders, and writes only code that compiles. `--diff` previews.
|
|
14
|
+
- Configuration in `slopdam.toml` or `[tool.slopdam]` in `pyproject.toml` (profile, level, disable, dash.inline, lint.scope/include/exclude), plus `--config` and `SLOPDAM_CONFIG`. Uses `tomllib` on Python 3.11+ and a built-in subset parser before that.
|
|
15
|
+
- `check --scope strings`: checks Python string literals instead of lines.
|
|
16
|
+
- Exit code `2` for usage and configuration errors.
|
|
17
|
+
- MIT license, contribution guide (DCO), code of conduct, security policy and governance, in English and Korean.
|
|
18
|
+
|
|
19
|
+
### Output changes
|
|
20
|
+
- `md.emphasis` no longer treats `__x__` as bold. It used to suggest removing `__name__` in `logging.getLogger(__name__)`. Only `**x**` is handled.
|
|
21
|
+
- `check` on Python files (default `log-calls` scope) reads the string arguments of log calls from the syntax tree instead of whole lines. Results now match `fix`: a dash next to a placeholder such as `%s` and a status emoji at the start of a string are judged correctly. Other languages are still checked line by line.
|
|
22
|
+
- Removing an emoji also removes the spaces right after it, so `a\n⚠️ b` becomes `a\nb` instead of `a\n b`. Indentation and the space after a keycap (`1️⃣`) are kept.
|
|
23
|
+
- Linter suggestions match the cleaned output: rules are applied in the same order as `clean()`. For example, in `**저장 완료** ㅡ 다음` the suggestion for `ㅡ` is now `: ` instead of removal. Characters inside protected spans are no longer reported.
|
|
24
|
+
- A dash inside a sentence becomes `: ` instead of ` - ` in the `reader` profile (`완료 — 다음` becomes `완료: 다음`). Use `--profile dev` or `--dash-inline hyphen` for the previous result.
|
|
25
|
+
- `ㅡㅡ` is removed (it used to be kept).
|
|
26
|
+
- `!` right after Hangul becomes `.` by default (it used to require the `ko` preset).
|
|
27
|
+
- The `default`, `ko` and `strict` presets are replaced by profiles and levels.
|
|
28
|
+
|
|
29
|
+
## [0.1.0]
|
|
30
|
+
|
|
31
|
+
### Added
|
|
32
|
+
- Rule engine, Python `logging` formatter and filter, `check` and `clean` commands, pre-commit hook.
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
# 행동 강령
|
|
2
|
+
|
|
3
|
+
[English](CODE_OF_CONDUCT.md) | [한국어](CODE_OF_CONDUCT.ko.md)
|
|
4
|
+
|
|
5
|
+
slopdam은 [Contributor Covenant 2.1](https://www.contributor-covenant.org/version/2/1/code_of_conduct/)을 행동 강령으로 채택합니다. 원문과 번역의 뜻이 다르면 원문(영어)을 따릅니다.
|
|
6
|
+
|
|
7
|
+
## 요약
|
|
8
|
+
|
|
9
|
+
- 서로 존중하고, 다른 의견과 경험을 환영합니다.
|
|
10
|
+
- 괴롭힘, 차별적인 언행, 다른 사람의 개인 정보 공개, 성적인 언행은 허용하지 않습니다.
|
|
11
|
+
- 메인테이너는 이 규칙을 어긴 댓글, 커밋, 이슈를 고치거나 지울 수 있고, 참여를 제한할 수 있습니다.
|
|
12
|
+
|
|
13
|
+
## 신고
|
|
14
|
+
|
|
15
|
+
메인테이너의 GitHub 프로필에 있는 연락처로 알려 주세요. 신고는 비밀로 다룹니다. 메인테이너 본인이 관련된 신고라면 그 메인테이너는 처리에서 빠집니다.
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
# Code of Conduct
|
|
2
|
+
|
|
3
|
+
[English](CODE_OF_CONDUCT.md) | [한국어](CODE_OF_CONDUCT.ko.md)
|
|
4
|
+
|
|
5
|
+
slopdam adopts the [Contributor Covenant, version 2.1](https://www.contributor-covenant.org/version/2/1/code_of_conduct/) as its code of conduct.
|
|
6
|
+
|
|
7
|
+
## In short
|
|
8
|
+
|
|
9
|
+
- Be respectful, and welcome different views and experiences.
|
|
10
|
+
- Harassment, discriminatory language, publishing others' private information and sexualized language or behavior are not acceptable.
|
|
11
|
+
- Maintainers may edit or remove comments, commits and issues that break these rules, and may restrict participation.
|
|
12
|
+
|
|
13
|
+
## Reporting
|
|
14
|
+
|
|
15
|
+
Contact a maintainer through the contact details on their GitHub profile. Reports are handled confidentially. If a maintainer is involved in a report, that maintainer does not take part in handling it.
|
|
@@ -0,0 +1,65 @@
|
|
|
1
|
+
# 기여 가이드
|
|
2
|
+
|
|
3
|
+
[English](CONTRIBUTING.md) | [한국어](CONTRIBUTING.ko.md)
|
|
4
|
+
|
|
5
|
+
도와주셔서 고맙습니다. 이 문서는 개발 환경, 모든 커밋에 필요한 서명, 규칙을 바꿀 때 갖춰야 할 것을 설명합니다.
|
|
6
|
+
|
|
7
|
+
## 시작하기
|
|
8
|
+
|
|
9
|
+
```bash
|
|
10
|
+
pip install -e . pytest
|
|
11
|
+
python -m pytest
|
|
12
|
+
```
|
|
13
|
+
|
|
14
|
+
## 커밋 서명 (DCO)
|
|
15
|
+
|
|
16
|
+
slopdam은 CLA 대신 [Developer Certificate of Origin 1.1](https://developercertificate.org/)을 씁니다. 모든 커밋에 `Signed-off-by` 줄이 필요하며, `git commit -s`가 자동으로 붙여 줍니다.
|
|
17
|
+
|
|
18
|
+
```bash
|
|
19
|
+
git commit -s -m "dash: 반각 ㅡ(U+FFDA) 탐지"
|
|
20
|
+
```
|
|
21
|
+
|
|
22
|
+
서명은 "이 변경을 MIT 라이선스로 제출할 권리가 나에게 있다"는 확인입니다. AI 도구로 작성한 코드도 마찬가지로, 제출한 내용에 대한 책임은 제출한 사람에게 있습니다.
|
|
23
|
+
|
|
24
|
+
## 규칙 추가와 변경
|
|
25
|
+
|
|
26
|
+
규칙 PR에는 다음이 모두 있어야 합니다([docs/RULES.ko.md](docs/RULES.ko.md)의 체크리스트 참고).
|
|
27
|
+
|
|
28
|
+
1. **반드시 걸려야 하는 입력**
|
|
29
|
+
2. **걸리면 안 되는 입력**: 날짜, 명령줄 옵션, 한자와 가나 본문, `ㅋㅋ` 등
|
|
30
|
+
3. **두 프로필의 기대 결과**: `reader`와 `dev`
|
|
31
|
+
4. **레벨**(`basic`, `strong`, `strict`)과 그 이유
|
|
32
|
+
5. **멱등성 사례**: 두 번 정리해도 결과가 같아야 합니다.
|
|
33
|
+
6. **ReDoS에 안전한 정규식**: `(a+)+` 같은 중첩 수량자와 `(a|a)*` 같은 겹치는 선택지 반복을 쓰지 않습니다. [SECURITY.ko.md](SECURITY.ko.md) 참고
|
|
34
|
+
7. **출처**: 다른 프로젝트에서 가져온 목록이면 출처를 밝히고, 아래 허용 목록의 라이선스여야 합니다. 다른 도구에서 아이디어를 얻는 것은 환영하지만 목록을 그대로 옮기지는 않습니다.
|
|
35
|
+
|
|
36
|
+
## 출력이 바뀌는 변경
|
|
37
|
+
|
|
38
|
+
slopdam의 출력은 사용자의 로그 형식 그 자체입니다. 그래서 출력이 바뀌면 호환성이 바뀝니다.
|
|
39
|
+
|
|
40
|
+
- PR 제목에 `[output-change]`를 붙입니다.
|
|
41
|
+
- [CHANGELOG.md](CHANGELOG.md)의 "Output changes"에 바뀌기 전과 후의 예시를 적습니다.
|
|
42
|
+
- 버전은 [GOVERNANCE.ko.md](GOVERNANCE.ko.md)의 출력 안정성 정책을 따릅니다.
|
|
43
|
+
|
|
44
|
+
## 의존성과 데이터
|
|
45
|
+
|
|
46
|
+
slopdam은 실행에 필요한 의존성이 없고, 앞으로도 그렇게 유지하려 합니다.
|
|
47
|
+
|
|
48
|
+
| 종류 | 허용 라이선스 (SPDX) |
|
|
49
|
+
|---|---|
|
|
50
|
+
| 선택적 실행 의존성 | `MIT`, `BSD-2-Clause`, `BSD-3-Clause`, `Apache-2.0`, `ISC`, `PSF-2.0`, `CNRI-Python` |
|
|
51
|
+
| 포함하는 데이터 | `Unicode-3.0`, `MIT`, `CC0-1.0` |
|
|
52
|
+
| 받지 않음 | `GPL-*`, `AGPL-*`, `LGPL-*`, `SSPL-*`, 라이선스가 없는 것 |
|
|
53
|
+
|
|
54
|
+
의존성이나 데이터를 추가하는 PR은 [THIRD_PARTY_NOTICES.md](THIRD_PARTY_NOTICES.md)도 함께 고칩니다.
|
|
55
|
+
|
|
56
|
+
## 커밋과 PR
|
|
57
|
+
|
|
58
|
+
- 커밋 제목은 `<규칙 군 또는 영역>: <요약>` 형식입니다. 예: `emoji: 국기 시퀀스 처리`, `cli: json 출력 추가`
|
|
59
|
+
- PR 하나에는 주제 하나만 담습니다.
|
|
60
|
+
- 이 저장소도 자기 린터를 통과해야 합니다. `src/`의 로그 문자열과 커밋 메시지에 긴 대시, 장식 이모지, 구분선을 쓰지 않습니다(`slopdam check src/`). 규칙 정의, 테스트, 문서의 예시는 예외입니다.
|
|
61
|
+
- 문서는 영어판이 기준입니다. 한국어판(`*.ko.md`)이 있는 문서를 고치면 같은 PR에서 함께 고치거나, 번역이 필요하다고 PR 설명에 적어 주세요.
|
|
62
|
+
|
|
63
|
+
## 행동 강령
|
|
64
|
+
|
|
65
|
+
모든 참여자는 [행동 강령](CODE_OF_CONDUCT.ko.md)을 따릅니다.
|
|
@@ -0,0 +1,65 @@
|
|
|
1
|
+
# Contributing
|
|
2
|
+
|
|
3
|
+
[English](CONTRIBUTING.md) | [한국어](CONTRIBUTING.ko.md)
|
|
4
|
+
|
|
5
|
+
Thank you for helping. This guide covers setup, the sign-off every commit needs, and what a rule change has to include.
|
|
6
|
+
|
|
7
|
+
## Getting started
|
|
8
|
+
|
|
9
|
+
```bash
|
|
10
|
+
pip install -e . pytest
|
|
11
|
+
python -m pytest
|
|
12
|
+
```
|
|
13
|
+
|
|
14
|
+
## Sign your commits (DCO)
|
|
15
|
+
|
|
16
|
+
slopdam uses the [Developer Certificate of Origin 1.1](https://developercertificate.org/) instead of a CLA. Every commit needs a `Signed-off-by` line, which `git commit -s` adds for you.
|
|
17
|
+
|
|
18
|
+
```bash
|
|
19
|
+
git commit -s -m "dash: detect halfwidth eu (U+FFDA)"
|
|
20
|
+
```
|
|
21
|
+
|
|
22
|
+
By signing off you confirm that you have the right to submit the change under the MIT license. The same applies to code written with AI tools: you are responsible for what you submit.
|
|
23
|
+
|
|
24
|
+
## Adding or changing a rule
|
|
25
|
+
|
|
26
|
+
A rule pull request needs all of the following (see the checklist in [docs/RULES.md](docs/RULES.md)):
|
|
27
|
+
|
|
28
|
+
1. **Inputs that must be caught.**
|
|
29
|
+
2. **Inputs that must not be caught**, such as dates, command line flags, CJK text or `ㅋㅋ`.
|
|
30
|
+
3. **Expected output for both profiles**, `reader` and `dev`.
|
|
31
|
+
4. **A level** (`basic`, `strong` or `strict`) and why.
|
|
32
|
+
5. **An idempotency case**: running the cleaner twice must give the same result.
|
|
33
|
+
6. **A ReDoS-safe pattern.** No nested quantifiers such as `(a+)+` and no overlapping alternatives inside a repetition such as `(a|a)*`. See [SECURITY.md](SECURITY.md).
|
|
34
|
+
7. **Provenance** for any list taken from another project, with a license on the allowlist below. Ideas from other tools are welcome; copied lists are not.
|
|
35
|
+
|
|
36
|
+
## Changes to output
|
|
37
|
+
|
|
38
|
+
slopdam's output is the user's log format, so a change in output is a compatibility change.
|
|
39
|
+
|
|
40
|
+
- Add `[output-change]` to the pull request title.
|
|
41
|
+
- Add a before and after example under "Output changes" in [CHANGELOG.md](CHANGELOG.md).
|
|
42
|
+
- Versioning follows the output stability policy in [GOVERNANCE.md](GOVERNANCE.md).
|
|
43
|
+
|
|
44
|
+
## Dependencies and data
|
|
45
|
+
|
|
46
|
+
slopdam has no runtime dependencies, and we want to keep it that way.
|
|
47
|
+
|
|
48
|
+
| Kind | Allowed licenses (SPDX) |
|
|
49
|
+
|---|---|
|
|
50
|
+
| Optional runtime dependency | `MIT`, `BSD-2-Clause`, `BSD-3-Clause`, `Apache-2.0`, `ISC`, `PSF-2.0`, `CNRI-Python` |
|
|
51
|
+
| Bundled data | `Unicode-3.0`, `MIT`, `CC0-1.0` |
|
|
52
|
+
| Not accepted | `GPL-*`, `AGPL-*`, `LGPL-*`, `SSPL-*`, or no stated license |
|
|
53
|
+
|
|
54
|
+
A pull request that adds a dependency or data file also updates [THIRD_PARTY_NOTICES.md](THIRD_PARTY_NOTICES.md).
|
|
55
|
+
|
|
56
|
+
## Commits and pull requests
|
|
57
|
+
|
|
58
|
+
- Commit subjects follow `<rule group or area>: <summary>`, for example `emoji: handle flag sequences` or `cli: add json output`.
|
|
59
|
+
- One topic per pull request.
|
|
60
|
+
- The repository has to pass its own linter: no em dashes, decorative emoji or separator lines in log strings under `src/` or in commit messages (`slopdam check src/`). Rule definitions, tests and examples in the docs are the exception.
|
|
61
|
+
- Documentation is written in English first. If you change a document that has a Korean version (`*.ko.md`), update it in the same pull request or say in the description that it needs a translation.
|
|
62
|
+
|
|
63
|
+
## Code of Conduct
|
|
64
|
+
|
|
65
|
+
Everyone taking part follows the [Code of Conduct](CODE_OF_CONDUCT.md).
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
# 운영 방식
|
|
2
|
+
|
|
3
|
+
[English](GOVERNANCE.md) | [한국어](GOVERNANCE.ko.md)
|
|
4
|
+
|
|
5
|
+
## 역할
|
|
6
|
+
|
|
7
|
+
| 역할 | 할 수 있는 일 | 되는 방법 |
|
|
8
|
+
|---|---|---|
|
|
9
|
+
| 기여자 | 이슈와 PR 등록, 리뷰 | 누구나 |
|
|
10
|
+
| 커미터 | PR 승인과 병합, 이슈 분류 | 의미 있는 PR이 5개 이상 병합된 뒤 메인테이너가 추천 |
|
|
11
|
+
| 메인테이너 | 릴리스, 로드맵, 보안 대응, 역할 부여 | 커미터 가운데 메인테이너들의 합의로 선정 |
|
|
12
|
+
|
|
13
|
+
지금은 창시자 한 사람이 메인테이너입니다. 메인테이너가 세 명이 되면 아래 결정 규칙을 그대로 적용합니다.
|
|
14
|
+
|
|
15
|
+
## 결정
|
|
16
|
+
|
|
17
|
+
- 일반 PR: 커미터 한 명이 승인하면 병합합니다.
|
|
18
|
+
- **출력이 바뀌는 PR**(`[output-change]`): 메인테이너 한 명을 포함해 두 명이 승인해야 합니다.
|
|
19
|
+
- 라이선스, 이 문서, 프로필과 레벨 체계의 변경: 7일 이상 공개 토론을 거쳐 메인테이너 전원이 합의해야 합니다.
|
|
20
|
+
- 합의가 안 되면 메인테이너 다수결로 정하고, 동수면 창시자가 정합니다.
|
|
21
|
+
|
|
22
|
+
## 버전과 출력 안정성
|
|
23
|
+
|
|
24
|
+
slopdam은 사람들의 로그 형식을 바꾸는 도구라서, 출력이 바뀌면 호환성이 바뀝니다. [Semantic Versioning](https://semver.org/)을 따르되, **기존 입력에 대한 출력**을 공개 API의 일부로 봅니다.
|
|
25
|
+
|
|
26
|
+
| 변경 | 0.x 동안 | 1.0부터 |
|
|
27
|
+
|---|---|---|
|
|
28
|
+
| 버그 수정(명백한 오탐 수정 포함) | 패치 | 패치 |
|
|
29
|
+
| 새 규칙(기본 꺼짐 또는 `strict` 전용) | 패치 | 마이너 |
|
|
30
|
+
| 새 규칙(`basic`에서 기본 켜짐) | 마이너 | **메이저**, 또는 다음 메이저까지 기본 꺼짐으로 제공 |
|
|
31
|
+
| 기존 규칙의 결과 변경 | 마이너 | 메이저 |
|
|
32
|
+
| Unicode 데이터 갱신 | 마이너 | 마이너(새로 잡히는 문자를 변경 기록에 명시) |
|
|
33
|
+
| 기본 프로필이나 레벨 변경 | 마이너 | 메이저 |
|
|
34
|
+
|
|
35
|
+
1.0부터는 출력이 바뀌지 않아야 하는 사용자를 위해 규칙 세트 버전을 고정하는 옵션(예: `ruleset = "1.0"`)을 제공할 예정입니다.
|
|
36
|
+
|
|
37
|
+
## 릴리스
|
|
38
|
+
|
|
39
|
+
- `vX.Y.Z` 태그를 푸시하면 GitHub Actions가 Trusted Publishing으로 PyPI에 배포합니다.
|
|
40
|
+
- 릴리스 노트는 [CHANGELOG.md](CHANGELOG.md)에서 가져옵니다.
|
|
41
|
+
|
|
42
|
+
## 이름과 상표
|
|
43
|
+
|
|
44
|
+
- 프로젝트 이름과 로고는 메인테이너가 관리합니다.
|
|
45
|
+
- 포크와 재배포는 MIT 라이선스에 따라 자유롭습니다. 다만 공식 배포판으로 오해할 수 있는 방식으로 같은 이름의 패키지를 배포하지는 말아 주세요.
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
# Governance
|
|
2
|
+
|
|
3
|
+
[English](GOVERNANCE.md) | [한국어](GOVERNANCE.ko.md)
|
|
4
|
+
|
|
5
|
+
## Roles
|
|
6
|
+
|
|
7
|
+
| Role | Can | How to become one |
|
|
8
|
+
|---|---|---|
|
|
9
|
+
| Contributor | Open issues and pull requests, review | Anyone |
|
|
10
|
+
| Committer | Approve and merge pull requests, triage issues | Nominated by a maintainer after five or more substantial merged pull requests |
|
|
11
|
+
| Maintainer | Release, set the roadmap, handle security reports, grant roles | Chosen from committers by agreement of the maintainers |
|
|
12
|
+
|
|
13
|
+
The founder is the only maintainer for now. The decision rules below apply in full once there are three maintainers.
|
|
14
|
+
|
|
15
|
+
## Decisions
|
|
16
|
+
|
|
17
|
+
- Regular pull requests: one committer approval.
|
|
18
|
+
- **Output changes** (`[output-change]`): two approvals, at least one from a maintainer.
|
|
19
|
+
- Changes to the license, this document, or the profile and level system: agreement of all maintainers, after a public discussion of at least 7 days.
|
|
20
|
+
- If maintainers cannot agree, a majority vote decides; on a tie, the founder decides.
|
|
21
|
+
|
|
22
|
+
## Versioning and output stability
|
|
23
|
+
|
|
24
|
+
slopdam changes the format of people's logs, so a change in output is a compatibility change. We follow [Semantic Versioning](https://semver.org/) and treat **the output for existing input** as part of the public API.
|
|
25
|
+
|
|
26
|
+
| Change | While 0.x | From 1.0 |
|
|
27
|
+
|---|---|---|
|
|
28
|
+
| Bug fix, including clear false positives | Patch | Patch |
|
|
29
|
+
| New rule, off by default or `strict` only | Patch | Minor |
|
|
30
|
+
| New rule, on by default in `basic` | Minor | **Major**, or ship it off by default until the next major |
|
|
31
|
+
| Different output from an existing rule | Minor | Major |
|
|
32
|
+
| Unicode data update | Minor | Minor, listing newly matched characters in the changelog |
|
|
33
|
+
| Different default profile or level | Minor | Major |
|
|
34
|
+
|
|
35
|
+
From 1.0, users who need fixed output will be able to pin a rule set version (for example `ruleset = "1.0"`).
|
|
36
|
+
|
|
37
|
+
## Releases
|
|
38
|
+
|
|
39
|
+
- Pushing a tag `vX.Y.Z` publishes to PyPI through GitHub Actions with Trusted Publishing.
|
|
40
|
+
- Release notes come from [CHANGELOG.md](CHANGELOG.md).
|
|
41
|
+
|
|
42
|
+
## Name and trademark
|
|
43
|
+
|
|
44
|
+
- The maintainers manage the project name and logo.
|
|
45
|
+
- Forks and redistribution are free under the MIT license. Please do not publish packages under the same name in a way that could be mistaken for the official release.
|
slopdam-0.2.0/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 The slopdam Authors
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
slopdam-0.2.0/PKG-INFO
ADDED
|
@@ -0,0 +1,140 @@
|
|
|
1
|
+
Metadata-Version: 2.5
|
|
2
|
+
Name: slopdam
|
|
3
|
+
Version: 0.2.0
|
|
4
|
+
Summary: Logger formatter and linter that strips AI-generated patterns (em dashes, emoji, separators, markdown) from log output
|
|
5
|
+
Project-URL: Homepage, https://github.com/slopdam/slopdam
|
|
6
|
+
Project-URL: Repository, https://github.com/slopdam/slopdam
|
|
7
|
+
Project-URL: Issues, https://github.com/slopdam/slopdam/issues
|
|
8
|
+
Project-URL: Changelog, https://github.com/slopdam/slopdam/blob/main/CHANGELOG.md
|
|
9
|
+
Author: The slopdam Authors
|
|
10
|
+
License-Expression: MIT
|
|
11
|
+
License-File: LICENSE
|
|
12
|
+
License-File: THIRD_PARTY_NOTICES.md
|
|
13
|
+
Keywords: ai,formatter,korean,linter,logging,slop
|
|
14
|
+
Classifier: Development Status :: 3 - Alpha
|
|
15
|
+
Classifier: Intended Audience :: Developers
|
|
16
|
+
Classifier: Natural Language :: English
|
|
17
|
+
Classifier: Natural Language :: Korean
|
|
18
|
+
Classifier: Programming Language :: Python :: 3
|
|
19
|
+
Classifier: Topic :: System :: Logging
|
|
20
|
+
Requires-Python: >=3.9
|
|
21
|
+
Description-Content-Type: text/markdown
|
|
22
|
+
|
|
23
|
+
# slopdam
|
|
24
|
+
|
|
25
|
+
[English](https://github.com/slopdam/slopdam/blob/main/README.md) | [한국어](https://github.com/slopdam/slopdam/blob/main/README.ko.md)
|
|
26
|
+
|
|
27
|
+
[](https://github.com/slopdam/slopdam/actions/workflows/ci.yml)
|
|
28
|
+
[](https://github.com/slopdam/slopdam/blob/main/LICENSE)
|
|
29
|
+
|
|
30
|
+
**A dam for AI slop in your logs.** slopdam removes the traces AI coding tools leave in log messages and console output: em dashes and look-alike lines (including the Korean `ㅡ`), decorative emoji, separator lines, markdown bold, curly quotes and invisible characters.
|
|
31
|
+
|
|
32
|
+
It works in two places:
|
|
33
|
+
|
|
34
|
+
- **When logs are written**: a `logging` formatter and filter clean every message on its way out, with no change to your code.
|
|
35
|
+
- **Before code is committed**: a linter reports traces in log calls, and a fixer rewrites the string literals in Python files.
|
|
36
|
+
|
|
37
|
+
The same trace becomes different text depending on who reads it:
|
|
38
|
+
|
|
39
|
+
```
|
|
40
|
+
input : ✅ **Saved** — 3 rows processed 🎉
|
|
41
|
+
reader: Saved: 3 rows processed
|
|
42
|
+
dev : [OK] Saved - 3 rows processed
|
|
43
|
+
```
|
|
44
|
+
|
|
45
|
+
- `reader` (default): plain text for people, such as CLI messages, alerts and reports.
|
|
46
|
+
- `dev`: grep-friendly text for log files and collectors. Status emoji become `[OK]`, `[FAIL]` and `[WARN]` instead of disappearing.
|
|
47
|
+
|
|
48
|
+
slopdam uses deterministic rules (regular expressions and character tables). It does not try to guess whether a model wrote the text: the same input always gives the same output, and every change can be traced to a rule ID.
|
|
49
|
+
|
|
50
|
+
## Install
|
|
51
|
+
|
|
52
|
+
slopdam needs Python 3.9 or later and has no runtime dependencies.
|
|
53
|
+
|
|
54
|
+
```bash
|
|
55
|
+
pip install slopdam
|
|
56
|
+
```
|
|
57
|
+
|
|
58
|
+
## Clean log output
|
|
59
|
+
|
|
60
|
+
```python
|
|
61
|
+
import logging
|
|
62
|
+
from slopdam import PlainFilter, PlainFormatter
|
|
63
|
+
|
|
64
|
+
console = logging.StreamHandler() # read by people
|
|
65
|
+
console.setFormatter(PlainFormatter("%(message)s")) # reader profile
|
|
66
|
+
console.addFilter(PlainFilter()) # drop lines that were only separators
|
|
67
|
+
|
|
68
|
+
file = logging.FileHandler("app.log") # read by tools
|
|
69
|
+
file.setFormatter(PlainFormatter("%(asctime)s %(levelname)s %(message)s", profile="dev"))
|
|
70
|
+
|
|
71
|
+
logging.basicConfig(level=logging.INFO, handlers=[console, file])
|
|
72
|
+
logging.info("✅ Synced %s rows — done", 3)
|
|
73
|
+
# console: Synced 3 rows: done
|
|
74
|
+
# app.log: 2026-11-23 ... INFO [OK] Synced 3 rows - done
|
|
75
|
+
```
|
|
76
|
+
|
|
77
|
+
- The original log record is never modified, so each handler can use its own profile.
|
|
78
|
+
- Tracebacks, URLs, inline code, `key=value` values and file paths are left untouched.
|
|
79
|
+
|
|
80
|
+
## Lint and fix source code
|
|
81
|
+
|
|
82
|
+
```bash
|
|
83
|
+
slopdam check src/ # report traces in log and print calls; exit 1 if any
|
|
84
|
+
slopdam --profile dev check src/ # suggestions in the dev style
|
|
85
|
+
slopdam fix --diff src/ # preview fixes to Python string literals
|
|
86
|
+
slopdam fix src/ # apply them
|
|
87
|
+
```
|
|
88
|
+
|
|
89
|
+
```
|
|
90
|
+
src/sync.py:8:18: emoji.pictograph '✅' -> ''
|
|
91
|
+
src/sync.py:8:25: dash.run 'ㅡ' -> ': '
|
|
92
|
+
```
|
|
93
|
+
|
|
94
|
+
Python files are read through the syntax tree, so slopdam knows exactly where each string starts and ends. `slopdam fix` changes only the literal text: quotes, prefixes, escape sequences, f-string expressions and placeholders such as `%s` stay as they are, and nothing is written unless the result compiles. Other languages are checked line by line.
|
|
95
|
+
|
|
96
|
+
To skip a line, add `# slopdam: ignore`, or `# slopdam: ignore[emoji]` to skip one rule group.
|
|
97
|
+
|
|
98
|
+
## Configuration
|
|
99
|
+
|
|
100
|
+
slopdam reads `slopdam.toml`, or the `[tool.slopdam]` table in `pyproject.toml`. Command line options take precedence.
|
|
101
|
+
|
|
102
|
+
```toml
|
|
103
|
+
profile = "dev"
|
|
104
|
+
level = "basic"
|
|
105
|
+
disable = ["emoji.status"]
|
|
106
|
+
|
|
107
|
+
[lint]
|
|
108
|
+
scope = "log-calls" # log-calls | strings | all
|
|
109
|
+
exclude = ["tests/**"]
|
|
110
|
+
```
|
|
111
|
+
|
|
112
|
+
## pre-commit and CI
|
|
113
|
+
|
|
114
|
+
```yaml
|
|
115
|
+
repos:
|
|
116
|
+
- repo: https://github.com/slopdam/slopdam
|
|
117
|
+
rev: v0.2.0
|
|
118
|
+
hooks:
|
|
119
|
+
- id: slopdam
|
|
120
|
+
```
|
|
121
|
+
|
|
122
|
+
Exit codes: `0` clean, `1` traces found (or `fix --diff` has changes), `2` usage or configuration error.
|
|
123
|
+
|
|
124
|
+
## Pipe
|
|
125
|
+
|
|
126
|
+
```bash
|
|
127
|
+
tail -f app.log | slopdam clean
|
|
128
|
+
```
|
|
129
|
+
|
|
130
|
+
## Rules
|
|
131
|
+
|
|
132
|
+
Every rule has an ID such as `dash.run` or `emoji.pictograph`, and can be turned off by ID or by group (`--disable emoji`). Profiles decide what a trace becomes, and levels decide how far slopdam goes: `basic` (default), `strong` (also removes filler words) and `strict` (also reports any non-ASCII symbol). See [docs/RULES.md](https://github.com/slopdam/slopdam/blob/main/docs/RULES.md) for the full catalog.
|
|
133
|
+
|
|
134
|
+
## Contributing
|
|
135
|
+
|
|
136
|
+
Contributions are welcome. Please read [CONTRIBUTING.md](https://github.com/slopdam/slopdam/blob/main/CONTRIBUTING.md); every commit needs a DCO sign-off (`git commit -s`). Report security issues privately as described in [SECURITY.md](https://github.com/slopdam/slopdam/blob/main/SECURITY.md). Project decisions follow [GOVERNANCE.md](https://github.com/slopdam/slopdam/blob/main/GOVERNANCE.md), and the community follows the [Code of Conduct](https://github.com/slopdam/slopdam/blob/main/CODE_OF_CONDUCT.md).
|
|
137
|
+
|
|
138
|
+
## License
|
|
139
|
+
|
|
140
|
+
[MIT](https://github.com/slopdam/slopdam/blob/main/LICENSE). Third-party components are listed in [THIRD_PARTY_NOTICES.md](https://github.com/slopdam/slopdam/blob/main/THIRD_PARTY_NOTICES.md).
|