This repository was archived by the owner on Jun 16, 2025. It is now read-only.
-
-
Notifications
You must be signed in to change notification settings - Fork 222
This repository was archived by the owner on Jun 16, 2025. It is now read-only.
Allow to define patterns against absolute file path (again) #589
Copy link
Copy link
Closed
Description
Hi! I'm opening this issue because it seems that the last time this issue was solved, the solution got lost at some point.
- Original issue: Allow to define patterns against absolute file path #107
- Solution: Support parser patterns based on file paths #108
- Line in change log: https://github.com/depcheck/depcheck/blob/62640856028eea8192d9c89952dc37258ece0611/CHANGELOG.md#070-beta1-2016-03-10
The solution introduced most notably this change:
Lines 123 to 126 in 98ad446
function checkFile(dir, filename, deps, parsers, detectors) { | |
const targets = lodash(parsers) | |
.keys() | |
.filter(glob => minimatch(filename, glob, { dot: true })) |
But on main
and master
, the change has gone missing, and the code still checks against the basename of files, making it impossible to have different parsers on different directories:
Lines 97 to 103 in adb2166
function checkFile(dir, filename, deps, parsers, detectors) { | |
debug('depcheck:checkFile')(filename); | |
const basename = path.basename(filename); | |
const targets = lodash(parsers) | |
.keys() | |
.filter((glob) => minimatch(basename, glob, { dot: true })) |
Could it be that this change was lost when 0.7.0 was released? The change was part of 0.7.0-beta, and it seems there were some chronology issues during that time: #304
indebanvdhamer
Metadata
Metadata
Assignees
Labels
No labels