Skip to content

False Positive "include_file_not_found" #59888

@RohitSaily

Description

@RohitSaily

Dart SDK version: 3.7.0-209.1.beta (beta) (Tue Dec 3 23:59:04 2024 -0800) on "macos_x64"

Including analysis options from another file can lead to an "include_file_not_found" error, even though the file is actually found and the options are included as expected. This issue occurs when the included path is quoted (whether using single or double quotes).

Expectation

When including analysis options from a file which definitely exists, the "analysis_options.yaml" file:

include: 'package:lints/recommended.yaml'

should function identically to:

include: package:lints/recommended.yaml

and:

include: "package:lints/recommended.yaml"

Reproduction

A Dart package with the following files can be constructed to reproduce this issue. This reproduction demonstrates that inclusion works, while the "include_file_not_found" error is still reported.

pubspec.yaml:

name: 'lint_test'
publish_to: 'none'
environment:
      sdk: '^3.7.0-209.1.beta'
dev_dependencies:
      lints: '^5.1.1'

analysis_options.yaml:

include: 'package:lints/recommended.yaml'

main.dart:

void main()=>
	null;

The error "include_file_not_found" is reported but the lint rule "avoid_returning_null_for_void" from the included file is enforced, indicating that the file was found.

Metadata

Metadata

Assignees

No one assigned

    Labels

    P3A lower priority bug or feature requestdevexp-linterIssues with the analyzer's support for the linter packagelegacy-area-analyzerUse area-devexp instead.linter-false-positiveIssues related to lint rules that report a problem when it isn't a problem.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions