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

feat: add fmt to plugin template #129

Merged
merged 1 commit into from
Jul 19, 2024
Merged
Show file tree
Hide file tree
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
14 changes: 14 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -52,3 +52,17 @@ distclean:
.PHONY: rel
rel: $(REBAR)
$(REBAR) emqx_plugrel tar

.PHONY: fmt
fmt: $(REBAR)
@find . \( -name '*.app.src' -o \
-name '*.erl' -o \
-name '*.hrl' -o \
-name 'rebar.config' -o \
-name '*.eterm' -o \
-name '*.escript' \) \
-not -path '*/_build/*' \
-not -path '*/deps/*' \
-not -path '*/_checkouts/*' \
-type f \
| xargs | $(REBAR) fmt --verbose -w
6 changes: 6 additions & 0 deletions README_template.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,5 +16,11 @@ In a shell from this plugin's working directory execute `make rel` to have the p
```
_build/default/emqx_plugrel/emqx_plugin_template-<vsn>.tar.gz
```
## Format

Format all the files in your project by running:
```
make fmt
```

See [EMQX documentation](https://docs.emqx.com/en/enterprise/v5.0/extensions/plugins.html) for details on how to deploy custom plugins.
2 changes: 1 addition & 1 deletion emqx-plugin.template
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
{description, "Another amazing EMQX plugin."},
{version, "1.0.0", "The release version of this plugin."},
{app_vsn, "0.1.0", "The erlang application vsn value."},
{emqx_vsn, "v5.6.1", "EMQX version to use as a dependency."},
{emqx_vsn, "v5.7.1", "EMQX version to use as a dependency."},
{license, "Apache-2.0", "Short identifier for license you want to distribute this plugin under."},
{author_website, "http://example.com", "A website with details about the author."},
{repo, "https://github.com/emqx/emqx-plugin-template", "Where to find the source code for this plugin."}
Expand Down
3 changes: 2 additions & 1 deletion rebar_template.config
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,8 @@
]}.

{plugins, [
{emqx_plugrel, {git, "https://github.com/emqx/emqx_plugrel.git", {tag, "0.5.0"}}}
{emqx_plugrel, {git, "https://github.com/emqx/emqx_plugrel.git", {tag, "0.5.0"}}},
{erlfmt, "1.3.0"}
]}.

{erl_opts, [debug_info]}.
Expand Down
Loading