Skip to content

docs: windows plugin development #2334

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

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 5 additions & 1 deletion docs/user-guide/plugins.md
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,11 @@ plugin "foo" {
}
```

When the plugin is enabled, TFLint invokes the `tflint-ruleset-[name]` (`tflint-ruleset-[name].exe` on Windows) binary in the plugin directory (For instance, `~/.tflint.d/plugins/tflint-ruleset-[name]`). So you should move the binary into the directory in advance.
When enabled, TFLint looks for the plugin binary following the pattern tflint-ruleset-\[name] (or tflint-ruleset-\[name].exe on Windows) directly in your plugins folder (e.g., ~/.tflint.d/plugins/ on Unix-like systems or C:\Users\\[username]\\.tflint.d\plugins\ on Windows).
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

By the way, to be honest, there is an issue with the location of files in Windows...
It should probably be placed in %APPDATA%/tflint.d/plugins like Terraform.
https://developer.hashicorp.com/terraform/cli/config/config-file#implied-local-mirror-directories


Thus, with the configuration above where the plugin name is "foo", the executable must be named tflint-ruleset-foo (or tflint-ruleset-foo.exe on Windows). So you should move the binary into the plugin directory in advance.

**Important for Windows Users:** On Windows, make sure to place the executable directly into the plugins folder (e.g. C:\Users\\[username]\\.tflint.d\plugins\) without using any subfolders. This direct placement is required for TFLint to detect and load the plugin correctly.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is this sentence necessary? I don't think there is any difference between Windows and Unix, except for the .exe extension in the file name.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I agree can remove "Important for Windows Users:" the other clarification sentence would have helped me to figure out my problem faster. WDYT ?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Personally, I think this sentence should be removed altogether.

I understand that your misunderstanding arose because it was unclear in the original sentence whether "(For instance, ~/.tflint.d/plugins/tflint-ruleset-[name])" referred to "the plugin directory" or "binary in the plugin directory".

Since the revised sentence does not contain this ambiguity, I do not think it is necessary to emphasize this issue so much.


## Bundled plugin

Expand Down
Loading