- Pre-render message templates before iterating users
- Pre-parse locations and venues before iterating users
- Inline trivial templateMessage wrapper into call site
- Extract escapeMarkdownFields variadic helper for bulk field escaping
- Use strings.TrimSpace instead of strings.Trim(" ") for robustness
- Pre-allocate slices in trimElement, escapeMarkdown, and globList
- Fix comment typo and inconsistent audio caption trailing period
- Replace fmt.Printf with log.Printf to satisfy forbidigo
- Fix ineffectual assignment to err in proxy block by avoiding variable shadowing
- Format long lines with golines
- Use assert.Error/NoError instead of NotNil/Nil for error assertions
- Use assert.True/False instead of Equal for boolean assertions
- Use assert.Empty instead of Equal with len check
- Use require for mid-test error assertions that guard subsequent operations
- Add testify/require import
- Replace os.Open/bufio/io.ReadAll with os.ReadFile in loadTextFromFile
- Guard proxy URL parsing inside socks5 check to avoid false errors
- Remove redundant trimElement wrapping around globList calls
- Remove dead title assignment in convertLocation
- Switch Plugin methods to pointer receivers to avoid struct copying
- Use %w for error wrapping in fmt.Errorf calls
- Fix "unmarshall" typos to "unmarshal" in error messages
- Fix duplicate DIST variable and GXZ_PAGAGE typo in Makefile
- Add a new `.golangci.yml` configuration file with a list of enabled linters
- Exclude `lll` linter for lines starting with `//go:generate`
- Replace `strings.Replace` with `strings.ReplaceAll` in `plugin.go` for markdown escaping and error message sanitization
- Simplify time addition expressions in `plugin_test.go` by removing unnecessary `time.Duration` conversions
Signed-off-by: Bo-Yi Wu <appleboy.tw@gmail.com>
- Change in main.go: Replaced `godotenv.Load(filename)` with `_ = godotenv.Load(filename)`
- Change in main.go: Replaced `godotenv.Overload("/run/drone/env")` with `_ = godotenv.Overload("/run/drone/env")`
- Change in plugin.go: Added import for "io"
- Change in plugin.go: Replaced `ioutil.ReadAll(r)` with `io.ReadAll(r)`
Signed-off-by: Bo-Yi Wu <appleboy.tw@gmail.com>
* Create a constant for 'markdown' formatting style, to reduce duplicated strings and make the code less error-prone
* Unescape HTML entities from text messages
* Fix DOCS.md example configuration with custom message from file
* Move .test.message to a better named file
* Add support for additional, custom extra vars to be used in the message template
* Add cmdline/envvars to support the extra vars
* Enhance DOCS.md with example configuration using generic template file with custom vars
* Add testcase for custom template vars
* Add support for external message loaded from the file specified in Config.MessageFile
* Enable the message file option in command line/env vars
* Update docs
* Add a testcase
* Fix YAML tag in DOCS.md from 'messageFile' to 'message_file', as is commonly used in Drone
* Remove unintended blank line
* Move .test.message file to tests/ folder