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
Add mage watch
command
#563
Conversation
|
@@ -11,6 +11,9 @@ min-occurrences = 2 | |||
[linters-settings.revive] | |||
ignore-generated-header = false | |||
|
|||
[linters-settings.misspell] | |||
ignore-words = ["unknwon"] |
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.
this was needed because the misspell linter was complaining about the "github.com/unknwon/bra/cmd"
import
be52a20
to
640d8fb
Compare
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.
LGTM. Nice 👍
Added some comments
Can you please make sure to update the following documentation when this is merged:
- https://grafana.com/docs/grafana/latest/developers/plugins/development-with-local-grafana/#run-your-plugin
- https://github.com/grafana/plugin-tools/blob/main/packages/create-plugin/templates/_partials/backend-getting-started.md (let us know if you want us to update this by creating an issue in that repo)
app.Action = func(c *cli.Context) error { | ||
return bra.Run.Run(c) | ||
} | ||
return app.Run(os.Args) |
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.
Would be good to verify this works on Windows, maybe you can ask someone when this has been merged?
watch_all = true | ||
follow_symlinks = false | ||
watch_dirs = [ | ||
"pkg", |
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.
Would be nice to reload when plugin.json is changed as well, but maybe leave that for 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.
sounds good. i'll add that 👍
thanks for the tip, i wasn't aware that the backend was dependent on plugin.json
. how is it used?
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.
added by dc48129. it doesn't look like it's possible to specify a single file, so i configured it to watch for changes to .go
or .json
files in src
or pkg
What this PR does / why we need it:
This adds a
mage watch
command that uses bra to watch for changes to.go
files in thepkg
directory of a plugin. A default.bra.toml
config is created if it does not exist.Which issue(s) this PR fixes:
Fixes #
Special notes for your reviewer:
It's unclear if
bra
is the best option for this task, but it seemed like a safe choice since grafana uses it.