Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use utils.parseArgs instead of meow #601

Open
1 task
azu opened this issue Aug 9, 2023 · 1 comment
Open
1 task

Use utils.parseArgs instead of meow #601

azu opened this issue Aug 9, 2023 · 1 comment
Labels
good first issue Good for newcomers Status: PR Welcome Welcome to Pull Request Status: Proposal Request for comments Type: Refactoring A code change that neither fixes a bug nor adds a feature

Comments

@azu
Copy link
Member

azu commented Aug 9, 2023

meow dependencies are large.
https://npmgraph.js.org/?q=secretlint
image

We can replace it with util.parseArgs([config]).

TODO

export const cli = meow(
`
Usage
$ secretlint [file|glob*]
Note
supported glob syntax is based on microglob
https://github.com/micromatch/micromatch#matching-features
Options
--init setup config file. Create .secretlintrc.json file from your package.json
--format [String] formatter name. Default: "stylish". Available Formatter: ${getFormatterList()
.map((item) => item.name)
.join(", ")}
--output [path:String] output file path that is written of reported result.
--no-color disable ANSI-color of output.
--no-terminalLink disable terminalLink of output.
--maskSecrets enable masking of secret values. replace actual secrets with "***".
--secretlintrc [path:String] path to .secretlintrc config file. Default: .secretlintrc.*
--secretlintignore [path:String] path to .secretlintignore file. Default: .secretlintignore
Options for Developer
--profile Enable performance profile.
--secretlintrcJSON [String] a JSON string of .secretlintrc. use JSON string instead of rc file.
Experimental Options
--locale [String] locale tag for translating message. Default: en
Examples
$ secretlint ./README.md
# glob pattern should be wrapped with double quote
$ secretlint "**/*"
$ secretlint "source/**/*.ini"
# found secrets and mask the secrets
$ secretlint .zsh_history --format=mask-result --output=.zsh_history
Exit Status
Secretlint exits with the following values:
- 0:
- Linting succeeded, no errors found.
- Found lint error but --output is specified.
- 1:
- Linting failed, errors found.
- 2:
- Unexpected error occurred, fatal error.
`,
{
flags: {
init: {
type: "boolean",
},
format: {
type: "string",
default: "stylish",
},
output: {
type: "string",
},
secretlintrc: {
type: "string",
},
secretlintrcJSON: {
type: "string",
},
secretlintignore: {
type: "string",
default: ".secretlintignore",
},
/**
* CLI enable ANSI-color of output by default
*/
color: {
type: "boolean",
default: true,
},
/**
* CLI enable terminalLink by default.
* Some formatter will output that includes clickable clink
* https://gist.github.com/egmontkob/eb114294efbcd5adb1944c9f3cb5feda
*/
terminalLink: {
type: "boolean",
default: true,
},
maskSecrets: {
type: "boolean",
default: false,
},
profile: {
type: "boolean",
},
locale: {
type: "string",
},
// DEBUG option
cwd: {
type: "string",
default: process.cwd(),
},
debug: {
type: "boolean",
default: false,
},
},
autoHelp: true,
autoVersion: true,
importMeta: import.meta,
}
);

@azu azu added Status: Proposal Request for comments Type: Refactoring A code change that neither fixes a bug nor adds a feature Status: PR Welcome Welcome to Pull Request good first issue Good for newcomers labels Aug 9, 2023
@azu azu mentioned this issue Nov 12, 2023
2 tasks
@azu
Copy link
Member Author

azu commented Nov 12, 2023

sindresorhus/meow#242
meow is bundled.

@azu azu changed the title User utils.parseArgs instead of meow Use utils.parseArgs instead of meow Nov 12, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
good first issue Good for newcomers Status: PR Welcome Welcome to Pull Request Status: Proposal Request for comments Type: Refactoring A code change that neither fixes a bug nor adds a feature
Projects
None yet
Development

No branches or pull requests

1 participant