← Documents Documentation/devicetree/bindings/.yamllint GitHub 원문 ↗

Linux 6.18.37 · Devicetree Bindings

Devicetree bindings yamllint configuration

Binding YAML의 quote, line length, spacing, comment, empty value와 indentation 규칙을 설명합니다.

Source pathDocumentation/devicetree/bindings/.yamllint
Source versionLinux v6.18.37
TranslationDUJINLABS 전문 번역 + 해설

요약·해설과 원문, 전문 번역을 서로 분리했습니다. API 이름, symbol, source path는 원문 표기를 사용합니다.

1. 요약·해설

원문의 핵심 논리와 kernel programming 관점의 보충 설명입니다. 아래의 전문 번역과는 별도로 작성했습니다.

요약과 해설

.yamllint:1-44

Relaxed profile을 기반으로 하되 binding schema의 일관성을 위해 flow spacing, document marker, empty value와 2-space indentation을 구체적으로 제한합니다.

2. 영어 원문 전체

번역 기준이 된 Linux v6.18.37 원문입니다. 줄 번호는 이 버전의 파일 좌표입니다.

원문 전체 펼치기
1 extends: relaxed
2
3 rules:
4 quoted-strings:
5 required: only-when-needed
6 extra-allowed:
7 - '[$^[]'
8 - '^/$'
9 line-length:
10 # 80 chars should be enough, but don't fail if a line is longer
11 max: 110
12 allow-non-breakable-words: true
13 level: warning
14 braces:
15 min-spaces-inside: 0
16 max-spaces-inside: 1
17 min-spaces-inside-empty: 0
18 max-spaces-inside-empty: 0
19 brackets:
20 min-spaces-inside: 0
21 max-spaces-inside: 1
22 min-spaces-inside-empty: 0
23 max-spaces-inside-empty: 0
24 colons: {max-spaces-before: 0, max-spaces-after: 1}
25 commas: {min-spaces-after: 1, max-spaces-after: 1}
26 comments:
27 require-starting-space: true
28 min-spaces-from-content: 1
29 comments-indentation: disable
30 document-start:
31 present: true
32 empty-lines:
33 max: 3
34 max-end: 1
35 empty-values:
36 forbid-in-block-mappings: true
37 forbid-in-flow-mappings: true
38 hyphens:
39 max-spaces-after: 1
40 indentation:
41 spaces: 2
42 indent-sequences: true
43 check-multi-line-strings: false
44 trailing-spaces: false
45

3. 한국어 전문 번역

영어 원문의 문단 순서와 의미를 유지한 전체 번역입니다. 코드, 함수명, symbol과 URL은 원문 표기를 유지합니다.

Devicetree binding YAML lint 규칙

1-44

이 설정은 yamllint의 `relaxed` profile을 확장하고 Devicetree binding YAML에 적용할 구체적인 formatting 규칙을 덮어씁니다.

`quoted-strings`는 필요한 경우에만 quote를 요구하며 `[$^[]`와 `^/$` pattern은 추가 허용 목록에 둡니다.

`line-length`는 최대 110자로 설정합니다. 끊을 수 없는 단어는 허용하고 초과 line은 failure가 아니라 warning으로 처리합니다. 원문 comment는 80자가 충분해야 하지만 더 긴 line 때문에 검사를 실패시키지는 않는다고 설명합니다.

`braces`와 `brackets` 내부 spacing은 일반적으로 0자에서 1자까지 허용하고 empty pair 내부에는 space를 허용하지 않습니다. Colon 앞은 0자, 뒤는 최대 1자이며 comma 뒤에는 정확히 1자의 space가 필요합니다.

Comment는 시작 space가 필요하고 content와 최소 1자 떨어져야 합니다. `comments-indentation` 검사는 비활성화합니다. YAML document start marker는 반드시 있어야 합니다.

연속 empty line은 최대 3개, 문서 끝은 최대 1개입니다. Block mapping과 flow mapping 모두 empty value를 금지하고 hyphen 뒤에는 최대 1자의 space만 허용합니다.

Indentation은 2 spaces이며 sequence도 indent합니다. Multi-line string indentation 검사는 하지 않습니다. `trailing-spaces: false`는 trailing-spaces rule 자체를 비활성화합니다.

extends: relaxed

rules:
  quoted-strings:
    required: only-when-needed
    extra-allowed:
      - '[$^[]'
      - '^/$'
  line-length:
    # 80 chars should be enough, but don't fail if a line is longer
    max: 110
    allow-non-breakable-words: true
    level: warning
  braces:
    min-spaces-inside: 0
    max-spaces-inside: 1
    min-spaces-inside-empty: 0
    max-spaces-inside-empty: 0
  brackets:
    min-spaces-inside: 0
    max-spaces-inside: 1
    min-spaces-inside-empty: 0
    max-spaces-inside-empty: 0
  colons: {max-spaces-before: 0, max-spaces-after: 1}
  commas: {min-spaces-after: 1, max-spaces-after: 1}
  comments:
    require-starting-space: true
    min-spaces-from-content: 1
  comments-indentation: disable
  document-start:
    present: true
  empty-lines:
    max: 3
    max-end: 1
  empty-values:
    forbid-in-block-mappings: true
    forbid-in-flow-mappings: true
  hyphens:
    max-spaces-after: 1
  indentation:
    spaces: 2
    indent-sequences: true
    check-multi-line-strings: false
  trailing-spaces: false
YAML lint 핵심 규칙
영역핵심 설정검사 수준
Quote필요할 때만 사용, pattern 2개 추가 허용Error
Line length최대 110자, non-breakable word 허용Warning
Flow spacingBrace/bracket 0~1자, comma 뒤 1자Error
Comment/document시작 space 필요, document start 필수Error
Empty valueBlock/flow mapping 모두 금지Error
Indentation2 spaces, sequence indentError
Trailing spacesRule 비활성화Disabled

설정 file의 rule을 formatting 영역별로 묶어 보여 줍니다.