Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Native server does not respect .gitignore #12254

Open
dhruvmanila opened this issue Jul 9, 2024 · 2 comments
Open

Native server does not respect .gitignore #12254

dhruvmanila opened this issue Jul 9, 2024 · 2 comments
Labels
bug Something isn't working server Related to the LSP server

Comments

@dhruvmanila
Copy link
Member

Following up on #12242, the native server does not respect .gitignore, specifically it does not consider the respect_gitignore file resolver setting.

@dhruvmanila dhruvmanila added bug Something isn't working server Related to the LSP server labels Jul 9, 2024
@dhruvmanila dhruvmanila added this to the Ruff Server: Stable milestone Jul 10, 2024
@dhruvmanila
Copy link
Member Author

dhruvmanila commented Jul 17, 2024

Currently, this is a bit difficult to figure out i.e., whether a single path is being gitignored or not. ruff-lsp didn't do that either because it uses stdin and ruff would always provide diagnostics if checked via stdin

/// Return `true` if the given top-level [`Path`] should be excluded.
fn is_file_excluded(path: &Path, resolver: &Resolver) -> bool {
// TODO(charlie): Respect gitignore.

The ignore crate has a Gitignore struct which could possibly be used but we'd still need to collect all the ignore files to consider in it.

@MichaReiser
Copy link
Member

I think I'm fine not supporting this for now. But yeah, we face a similar problem in red-knot. We may have to vendor the ignore crate longterm and check for every new file if it is excluded.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working server Related to the LSP server
2 participants