-
Notifications
You must be signed in to change notification settings - Fork 40
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix: remove unused support for file glob from command line (#1534)
## PR Checklist - [x] Addresses an existing open issue: fixes #1533 - [x] That issue was marked as [`status: accepting prs`](https://github.com/JoshuaKGoldberg/TypeStat/issues?q=is%3Aopen+is%3Aissue+label%3A%22status%3A+accepting+prs%22) - [x] Steps in [CONTRIBUTING.md](https://github.com/JoshuaKGoldberg/TypeStat/blob/main/.github/CONTRIBUTING.md) were taken ## Overview There seems to be undocumented code path that could potentially support giving file glob from command line. Since there is no tests for this and no documentation, it's hard to say is it working as intended currently. I think the current mindset is that these kind of settings would be in the json config file. This change makes the code simpler to understand. --------- Co-authored-by: Josh Goldberg ✨ <git@joshuakgoldberg.com>
- Loading branch information
1 parent
ac67a7c
commit f21114e
Showing
7 changed files
with
33 additions
and
26 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
import path from "node:path"; | ||
import { describe, expect, it } from "vitest"; | ||
|
||
import { collectFileNames } from "./collectFileNames.js"; | ||
|
||
describe("collectFileNames", () => { | ||
it("should collect files with wildcard when collection succeeds", async () => { | ||
const cwd = path.resolve(import.meta.dirname, ".."); | ||
const fileNames = await collectFileNames( | ||
path.resolve(import.meta.dirname), | ||
["*"], | ||
); | ||
expect(fileNames).toContain(`${cwd}/src/collectFileNames.test.ts`); | ||
}); | ||
|
||
it("should return error if node_modules are implicitly included", async () => { | ||
const cwd = path.resolve(import.meta.dirname, ".."); | ||
const fileNames = await collectFileNames(cwd, ["*"]); | ||
expect(fileNames).toEqual( | ||
`At least one path including node_modules was included implicitly: '${cwd}/node_modules'. Either adjust TypeStat's included files to not include node_modules (recommended) or explicitly include node_modules/ (not recommended).`, | ||
); | ||
}); | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters