Skip to content

Commit 237de89

Browse files
authored
chore!: drop include CLI flag (#877)
1 parent d50a3cb commit 237de89

File tree

5 files changed

+7
-58
lines changed

5 files changed

+7
-58
lines changed

src/bin/index.ts

+5-12
Original file line numberDiff line numberDiff line change
@@ -31,18 +31,11 @@ import { getConfigs } from '../parsers/options.js';
3131
const enforce = hasArg('enforce') || hasArg('x', '-');
3232
const configFile = getArg('config') || getArg('c', '-');
3333
const defaultConfigs = await getConfigs(configFile);
34-
const dirs: string[] = (() => {
35-
/* c8 ignore next 2 */ // Deprecated
36-
const includeArg = getArg('include');
37-
if (includeArg !== undefined) return includeArg.split(',');
38-
39-
return (
40-
getPaths('-') ??
41-
(defaultConfigs?.include
42-
? Array.prototype.concat(defaultConfigs?.include)
43-
: ['.'])
44-
);
45-
})();
34+
const dirs: string[] =
35+
getPaths('-') ??
36+
(defaultConfigs?.include
37+
? Array.prototype.concat(defaultConfigs?.include)
38+
: ['.']);
4639
const platform = getArg('platform');
4740
const filter = getArg('filter') ?? defaultConfigs?.filter;
4841
const exclude = getArg('exclude') ?? defaultConfigs?.exclude;

src/parsers/get-arg.ts

+2-4
Original file line numberDiff line numberDiff line change
@@ -34,11 +34,9 @@ export const getPaths = (
3434

3535
for (const arg of baseArgs) {
3636
if (arg.startsWith(prefix)) continue;
37+
if (!hasPaths) hasPaths = true;
3738

38-
hasPaths = true;
39-
const parts = arg.split(',');
40-
41-
for (const part of parts) paths.push(part);
39+
paths.push(arg);
4240
}
4341

4442
return hasPaths ? paths : undefined;

test/unit/args.test.ts

-20
Original file line numberDiff line numberDiff line change
@@ -69,16 +69,6 @@ describe('CLI Argument Handling Functions', () => {
6969
);
7070
});
7171

72-
it('should split paths by comma', () => {
73-
const args = ['path1,path2,path3'];
74-
const result = getPaths('--', args);
75-
assert.deepStrictEqual(
76-
result,
77-
['path1', 'path2', 'path3'],
78-
'Should split paths by comma'
79-
);
80-
});
81-
8272
it('should return undefined if no paths provided', () => {
8373
const args = ['--arg=value'];
8474
const result = getPaths('--', args);
@@ -89,16 +79,6 @@ describe('CLI Argument Handling Functions', () => {
8979
);
9080
});
9181

92-
it('should handle mixed arguments with and without prefix', () => {
93-
const args = ['--arg=value', 'path1', '--another=value', 'path2,path3'];
94-
const result = getPaths('--', args);
95-
assert.deepStrictEqual(
96-
result,
97-
['path1', 'path2', 'path3'],
98-
'Should return ["path1", "path2", "path3"]'
99-
);
100-
});
101-
10282
it('should handle empty array', () => {
10383
const args: string[] = [];
10484
const result = getPaths('--', args);

website/docs/documentation/poku/include-files.mdx

-11
Original file line numberDiff line numberDiff line change
@@ -93,17 +93,6 @@ npx poku --filter='' ./packages/**/test/unit/*.js
9393

9494
<hr />
9595

96-
### `--include`
97-
98-
<Stability
99-
level={0}
100-
message={
101-
"It's now possible to pass multiple paths in any position since v2.1.0."
102-
}
103-
/>
104-
105-
<hr />
106-
10796
## API
10897

10998
> `poku(targetPaths: string | string[])`

website/i18n/pt-BR/docusaurus-plugin-content-docs/current/documentation/poku/include-files.mdx

-11
Original file line numberDiff line numberDiff line change
@@ -93,17 +93,6 @@ npx poku --filter='' ./packages/**/test/unit/*.js
9393

9494
<hr />
9595

96-
### `--include`
97-
98-
<Stability
99-
level={0}
100-
message={
101-
'Agora é possível passar múltiplos caminhos em qualquer posição desde a v2.1.0.'
102-
}
103-
/>
104-
105-
<hr />
106-
10796
## API
10897

10998
> `poku(caminhosDoTestes: string | string[])`

0 commit comments

Comments
 (0)