-
Notifications
You must be signed in to change notification settings - Fork 0
docs: post-v1 accuracy and coverage update #3
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
Merged
Merged
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or 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 hidden or 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 hidden or 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,96 @@ | ||
| --- | ||
| title: flaglint completion | ||
| description: Output a shell completion script for bash, zsh, or fish. | ||
| lastUpdated: 2026-07-01 | ||
| --- | ||
|
|
||
| `flaglint completion` prints a shell completion script to stdout. Source it once and your shell will tab-complete subcommands, flags, and flag values (format choices, shell names, and more). | ||
|
|
||
| ## Command | ||
|
|
||
| ```bash | ||
| flaglint completion <shell> | ||
| ``` | ||
|
|
||
| Supported shells: `bash`, `zsh`, `fish`. | ||
|
|
||
| ## Installation | ||
|
|
||
| ### Bash | ||
|
|
||
| Load for the current session only: | ||
|
|
||
| ```bash | ||
| source <(flaglint completion bash) | ||
| ``` | ||
|
|
||
| Load permanently (add to `~/.bashrc` or `~/.bash_profile`): | ||
|
|
||
| ```bash | ||
| flaglint completion bash >> ~/.bash_completion | ||
| ``` | ||
|
|
||
| ### Zsh | ||
|
|
||
| Load for the current session only: | ||
|
|
||
| ```bash | ||
| source <(flaglint completion zsh) | ||
| ``` | ||
|
|
||
| Load permanently (requires `~/.zsh/completions` in your `$fpath`): | ||
|
|
||
| ```bash | ||
| mkdir -p ~/.zsh/completions | ||
| flaglint completion zsh > ~/.zsh/completions/_flaglint | ||
| ``` | ||
|
|
||
| Then ensure `$fpath` includes the directory before `compinit` runs — add to `~/.zshrc`: | ||
|
|
||
| ```zsh | ||
| fpath=(~/.zsh/completions $fpath) | ||
| autoload -Uz compinit && compinit | ||
| ``` | ||
|
|
||
| ### Fish | ||
|
|
||
| ```bash | ||
| flaglint completion fish > ~/.config/fish/completions/flaglint.fish | ||
| ``` | ||
|
|
||
| Fish auto-sources files in `~/.config/fish/completions/` on startup — no extra configuration needed. | ||
|
|
||
| ## What Gets Completed | ||
|
|
||
| - **Subcommands** — `audit`, `scan`, `migrate`, `validate`, `init`, `completion` | ||
| - **Flags** — all per-command flags and global flags (`--quiet`, `--verbose`) | ||
| - **Flag values** — `--format` values (`json`, `markdown`, `html`, `sarif`, `text`), completion shell names (`bash`, `zsh`, `fish`) | ||
| - **File arguments** — `--output`, `--config`, `--baseline`, `--write-baseline` complete against the filesystem | ||
|
|
||
| ## Examples | ||
|
|
||
| ```bash | ||
| # Print the bash completion script | ||
| flaglint completion bash | ||
|
|
||
| # Activate immediately in the current bash session | ||
| source <(flaglint completion bash) | ||
|
|
||
| # Write the zsh completion script to the standard completions directory | ||
| flaglint completion zsh > ~/.zsh/completions/_flaglint | ||
|
|
||
| # Write the fish completion file | ||
| flaglint completion fish > ~/.config/fish/completions/flaglint.fish | ||
| ``` | ||
|
|
||
| ## Exit Codes | ||
|
|
||
| | Code | Meaning | | ||
| | --- | --- | | ||
| | `0` | Script printed successfully. | | ||
| | `2` | No shell argument provided, or unsupported shell name. | | ||
|
|
||
| ## Feedback | ||
|
|
||
| - [Edit this page on GitHub](https://github.com/flaglint/flaglint.dev/edit/main/src/content/docs/docs/cli/completion.md) | ||
| - [Report an unsupported pattern](https://github.com/flaglint/flaglint/issues/new?template=unsupported_pattern.yml) | ||
This file contains hidden or 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 hidden or 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,86 @@ | ||
| --- | ||
| title: flaglint init | ||
| description: Scaffold a flaglint.config.json with all fields set to their defaults. | ||
| lastUpdated: 2026-07-01 | ||
| --- | ||
|
|
||
| `flaglint init` writes a `flaglint.config.json` to the current directory with every configuration field set to its default value. Run it once to get a starting config you can edit — no manual JSON authoring required. | ||
|
|
||
| ## Command | ||
|
|
||
| ```bash | ||
| npx flaglint init | ||
| ``` | ||
|
|
||
| ## Options | ||
|
|
||
| | Option | Description | | ||
| | --- | --- | | ||
| | `--output <path>` | Write the config to a different filename or path (default: `flaglint.config.json`). | | ||
| | `--force` | Overwrite an existing config file without error. | | ||
|
|
||
| ## Config Template Written | ||
|
|
||
| ```json | ||
| { | ||
| "include": ["**/*.{ts,tsx,js,jsx}"], | ||
| "exclude": [ | ||
| "**/node_modules/**", | ||
| "**/dist/**", | ||
| "**/build/**", | ||
| "**/.next/**", | ||
| "**/coverage/**", | ||
| "**/*.d.ts" | ||
| ], | ||
| "provider": "launchdarkly", | ||
| "minFileCount": 0, | ||
| "wrappers": [], | ||
| "openFeatureClientBindings": [], | ||
| "outputDir": "." | ||
| } | ||
| ``` | ||
|
|
||
| After writing, `flaglint init` prints a short explanation of each field to stderr so you know what to change. | ||
|
|
||
| ## Config Search Order | ||
|
|
||
| FlagLint loads the first matching file from this list: | ||
|
|
||
| ```text | ||
| .flaglintrc | ||
| .flaglintrc.json | ||
| flaglint.config.json | ||
| ``` | ||
|
|
||
| If you write to `flaglint.config.json` (the default) and `.flaglintrc` already exists in the same directory, FlagLint will load `.flaglintrc` instead — it has higher precedence. `flaglint init` warns you if this situation would occur. | ||
|
|
||
| Use `--output .flaglintrc` to write to the highest-precedence path instead, or `--config <path>` at runtime to use any file regardless of name. | ||
|
|
||
| ## Exit Codes | ||
|
|
||
| | Code | Meaning | | ||
| | --- | --- | | ||
| | `0` | Config file written successfully. | | ||
| | `2` | Config file already exists and `--force` was not passed. | | ||
|
|
||
| ## Examples | ||
|
|
||
| ```bash | ||
| # Write flaglint.config.json in the current directory | ||
| npx flaglint init | ||
|
|
||
| # Write to .flaglintrc (highest-precedence name) | ||
| npx flaglint init --output .flaglintrc | ||
|
|
||
| # Overwrite an existing config without prompting | ||
| npx flaglint init --force | ||
|
|
||
| # Write to a specific path | ||
| npx flaglint init --output config/flaglint.json | ||
| ``` | ||
|
|
||
| ## Feedback | ||
|
|
||
| - [Edit this page on GitHub](https://github.com/flaglint/flaglint.dev/edit/main/src/content/docs/docs/cli/init.md) | ||
| - [Report an unsupported pattern](https://github.com/flaglint/flaglint/issues/new?template=unsupported_pattern.yml) | ||
| - Next: [Configuration](/docs/cli/configuration/) |
This file contains hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
📐 Maintainability & Code Quality | 🟡 Minor | ⚡ Quick win
Create the Fish completions directory first.
~/.config/fish/completions/is not guaranteed to exist, so this install command can fail on a fresh machine. Add amkdir -pstep before the redirect.♻️ Proposed fix
### Fish ```bash +mkdir -p ~/.config/fish/completions flaglint completion fish > ~/.config/fish/completions/flaglint.fish🤖 Prompt for AI Agents