included_file_parse_error 진단: include 된 파일이 올바른 YAML이 아니에요
included_file_parse_error 진단: include 된 파일이 올바른 YAML이 아니에요
분석 옵션 파일에 include 된 파일의 내용이 올바른 YAML이 아니면 Dart 분석기가 이 진단을 내보내요. include로 가져온 파일도 분석 옵션 파일의 일부처럼 다뤄지기 때문에, 그 안도 유효한 YAML이어야 해요.
본문
설명
분석기는 분석 옵션 파일에 include 된 파일의 내용이 유효한 YAML이 아니면 이 진단을 만들어요.
예시
shared.yaml라는 파일에 다음 내용이 들어 있다고 할게요.
// %uri="shared.yaml"
analyzer:
enable-experiment:
- augmentations
enable-experiment:
- dot-shorthands
다음 코드는 include 된 파일이 유효한 YAML이 아니기 때문에 이 진단을 만들어요. analyzer 맵 안에 enable-experiment 키가 중복되어 있거든요.
// %uri="analysis_options.yaml"
include: shared.yaml
analyzer:
enable-experiment:
- enhanced-parts
흔한 해결 방법
그 파일을 include 하려는 의도라면, include 되는 파일을 유효한 YAML로 고쳐요.
// %uri="shared.yaml"
analyzer:
enable-experiment:
- augmentations
- dot-shorthands
그 파일을 include 할 의도가 아니라면, include 키를 제거해요.
// %uri="analysis_options.yaml"
analyzer:
enable-experiment:
- enhanced-parts