Commit 9761e94
authored
fix(apps/oxlint): incorrect matching in
The issue was discovered while updating test cases in `rolldown`.
In the `.oxlintignore` file, we have:
```ignore
tests/**
```
When running the command by `lint-staged`:
```bash
oxlint -c .oxlintrc.json --ignore-path=.oxlintignore --deny-warnings "tests/function/main.js"
```
The file `main.js` gets linted despite being ignored. This happens
because, before using `Gitignore::new`, we converted paths to absolute
paths, causing the pattern `tests/**` to not match
`D:/rolldown/tests/function/main.js` correctly.
https://github.com/oxc-project/oxc/blob/c61a383e8cc453fb92f85e6047426a86e50daba7/apps/oxlint/src/lint.rs#L60-L78.oxlintignore (#7566)1 parent e62153b commit 9761e94
4 files changed
Lines changed: 28 additions & 10 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
57 | 57 | | |
58 | 58 | | |
59 | 59 | | |
60 | | - | |
61 | | - | |
62 | | - | |
63 | | - | |
64 | | - | |
65 | | - | |
66 | | - | |
67 | | - | |
68 | | - | |
69 | | - | |
70 | 60 | | |
71 | 61 | | |
72 | 62 | | |
| |||
77 | 67 | | |
78 | 68 | | |
79 | 69 | | |
| 70 | + | |
| 71 | + | |
| 72 | + | |
| 73 | + | |
| 74 | + | |
| 75 | + | |
| 76 | + | |
| 77 | + | |
| 78 | + | |
| 79 | + | |
80 | 80 | | |
81 | 81 | | |
82 | 82 | | |
| |||
777 | 777 | | |
778 | 778 | | |
779 | 779 | | |
| 780 | + | |
| 781 | + | |
| 782 | + | |
| 783 | + | |
| 784 | + | |
| 785 | + | |
| 786 | + | |
| 787 | + | |
| 788 | + | |
| 789 | + | |
| 790 | + | |
| 791 | + | |
| 792 | + | |
| 793 | + | |
| 794 | + | |
780 | 795 | | |
0 commit comments