Files
clean-architecture-backend-…/config/checkstyle/checkstyle.xml
T
DongHyeonka 1388c06a9f refactor(layout)!: Gradle 루트와 계층 폴더를 옮긴다(옮기기만)
문제: Gradle 루트가 src/라서 빌드 도구(build-logic, gradle, config, 빌드
파일)가 계층 코드 폴더 옆에 섞여 있다. composition과 app-bootstrap은 같은
조립 계층인데 폴더가 따로이고, application 모듈 넷은 최상위에 흩어져 있다.
「Gradle은 src/에서 실행」이라는 예외 규칙이 모든 문서와 스크립트에 퍼졌다.

고른 방법: 저장소 루트를 Gradle 루트로 하고 src/에는 계층 코드만 둔다
(design-docs repo-structure/01-backend-layout.md 6.1절 가-2·가-3, 소유자
승인 2026-11-07). 이 커밋은 git mv만 한다. 이름 바꾸기 감지가 1541개
파일 모두를 R100으로 잡도록 내용을 바꾸지 않았다. 바뀐 곳은 둘뿐이다:
src/.gitignore의 줄을 루트 .gitignore로 옮겼다.

- 빌드 파일, gradle/, build-logic/ → 저장소 루트
- config/checkstyle·spotbugs → config/ (코드 검사 도구 설정만)
- registry config/architecture/modules.json → gradle/modules.json,
  시험 이미지 config/testing/container-images.properties
  → gradle/container-images.properties, registry 설명 → gradle/README.md
- Dockerfile, .dockerignore, .env*.example → 저장소 루트
- src/README.md(빌드·env 참조) → docs/build.md
- src/domain-core → src/domain/core,
  src/application-* → src/application/*,
  src/app-bootstrap → src/bootstrap/app,
  src/composition/* → src/bootstrap/*
- 기능 생성 템플릿 scripts/feature-scaffold/{templates,probes}/src/ 아래도
  같은 모양으로(domain/core, application/core, bootstrap/app)

위험: 이 커밋만으로는 빌드되지 않는다. 경로를 부르는 곳은 다음 커밋이
고친다. 두 커밋을 나눈 것은 파생 서비스가 merge할 때 이름 바꾸기와 내용
변경을 따로 보게 하려는 것이다.

검증: git diff --cached -M --name-status 에서 R100 1541개, 그 밖은
.gitignore 수정과 src/.gitignore 삭제뿐.

BREAKING CHANGE: 모든 빌드 파일과 계층 폴더의 경로가 바뀐다. 옛 경로 →
새 경로 표와 받는 순서는 docs/upgrade/2026-11-relayout.md에 있다.
Refs: design-docs repo-structure/01-backend-layout.md 6.1절
2026-11-11 21:04:21 +09:00

94 lines
4.6 KiB
XML

<?xml version="1.0"?>
<!DOCTYPE module PUBLIC
"-//Checkstyle//DTD Checkstyle Configuration 1.3//EN"
"https://checkstyle.org/dtds/configuration_1_3.dtd">
<!--
feature-static-analysis-quality-contract D2 — custom minimal Checkstyle ruleset.
Scope is deliberately limited to what google-java-format (Spotless, D1) CANNOT enforce:
naming and logical/design rules. Formatting and import-order modules are
intentionally ABSENT — the formatter owns them. Enabling LineLength/Indentation/Whitespace/
CustomImportOrder here would fight the formatter (checkstyle #6527) and trap CI in an
infinite reformat loop.
Test-source relaxations live in checkstyle-suppressions.xml (resolved via ${config_loc}).
-->
<module name="Checker">
<property name="charset" value="UTF-8"/>
<property name="severity" value="error"/>
<property name="fileExtensions" value="java"/>
<!-- Test-source + generated-source relaxations (checkstyleTest is warning-only anyway). -->
<module name="SuppressionFilter">
<property name="file" value="${config_loc}/checkstyle-suppressions.xml"/>
<property name="optional" value="false"/>
</module>
<module name="TreeWalker">
<!-- ================= naming (KEEP, blocking) — CS-C2 / CS-C5 ================= -->
<module name="TypeName"/>
<module name="MethodName"/>
<!-- ConstantName: real constants are UPPER_SNAKE_CASE (code-conventions N9), but a
Logger has mutable observable state so it is NOT a constant — Google §5.2.4 names
it lowerCamelCase (log/logger). Permit those two idiomatic logger names. -->
<module name="ConstantName">
<property name="format" value="^(log|logger|[A-Z][A-Z0-9]*(_[A-Z0-9]+)*)$"/>
</module>
<module name="MemberName"/>
<module name="StaticVariableName"/>
<module name="ParameterName"/>
<module name="LambdaParameterName"/>
<module name="CatchParameterName"/>
<module name="LocalVariableName"/>
<module name="LocalFinalVariableName"/>
<module name="PackageName"/>
<!-- Type parameters are UPPER alphanumeric. Allows the conventional T/E/K/V/R and the
F-bounded self-type idiom SELF (see ResourceId<SELF extends ResourceId<SELF>>). -->
<module name="ClassTypeParameterName">
<property name="format" value="^[A-Z][A-Z0-9]*$"/>
</module>
<module name="InterfaceTypeParameterName">
<property name="format" value="^[A-Z][A-Z0-9]*$"/>
</module>
<module name="MethodTypeParameterName">
<property name="format" value="^[A-Z][A-Z0-9]*$"/>
</module>
<module name="RecordComponentName"/>
<module name="RecordTypeParameterName">
<property name="format" value="^[A-Z][A-Z0-9]*$"/>
</module>
<module name="PatternVariableName"/>
<!-- ================= file/type structure (code-conventions I6) =================
One top-level type per file, and the file is named after it.
These replace the hand-rolled `verifyOneTypePerFile` Gradle task, which matched
`^public ...` line by line. That regex could not see a package-private top-level type
(126 main sources declared none that it matched at all), read only `src/main/java`,
and anchored at column 0 so a block comment or text-block line starting with `public`
would have counted as a declaration. Checkstyle parses the file, so all three go away.
Neither rule is redundant with javac. javac rejects a *public* type whose name does not
match the file; both of these also hold for package-private top-level types, which
javac accepts.
Scope is main source only, which is exactly what the task it replaces checked. Test
sources declare 29 co-located fixture types that these rules would reject, and widening
the rule while claiming to replace a task is two changes wearing one name — the
exemption is in checkstyle-suppressions.xml with the count. -->
<module name="OneTopLevelClass"/>
<module name="OuterTypeFilename"/>
<!-- ================= logical / design (KEEP) — google_checks CS-C1 ================= -->
<module name="NeedBraces"/>
<module name="FallThrough"/>
<module name="EmptyCatchBlock">
<property name="exceptionVariableName" value="expected|ignored"/>
</module>
<module name="OneStatementPerLine"/>
<module name="MissingSwitchDefault"/>
</module>
</module>