Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions news/2 Fixes/3947.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
Match dots in ignorePatterns globs; fixes .venv not being ignored
(thanks to [Russell Davis](https://github.com/russelldavis))
3 changes: 2 additions & 1 deletion src/client/linters/lintingEngine.ts
Original file line number Diff line number Diff line change
Expand Up @@ -197,7 +197,8 @@ export class LintingEngine implements ILintingEngine {
const relativeFileName = typeof workspaceRootPath === 'string' ? path.relative(workspaceRootPath, document.fileName) : document.fileName;

const settings = this.configurationService.getSettings(document.uri);
const ignoreMinmatches = settings.linting.ignorePatterns.map(pattern => new Minimatch(pattern));
// { dot: true } is important so dirs like `.venv` will be matched by globs
const ignoreMinmatches = settings.linting.ignorePatterns.map(pattern => new Minimatch(pattern, { dot: true }));
if (ignoreMinmatches.some(matcher => matcher.match(document.fileName) || matcher.match(relativeFileName))) {
return false;
}
Expand Down