template lint without parameters return false positive
Maintainers usually reply within 1 day
Nobody has claimed this yet.
Assessment
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Newbie friendliness
- 35/100
- Issue type
- Bug
- Clarity
- Mostly clear
- Activity status
- Stale
- Tech stack
- go
- Domain
- cli, testing-qa
Research direction
Start by reproducing the no-argument behavior for the test, lint, and template lint CLI entry points, including template lint -t, using the commands and expected exit codes in the issue. Trace how input paths and template parameters are handled, then verify that missing inputs fail and that -t causes the intended files to be linted. The verbose-output request is an additional scope to assess separately.
Written by the indexing model from the issue text.
Description
This is the help message from redpanda connect
$ docker run --rm redpandadata/connect:4.42 template lint --help
NAME:
redpanda-connect template lint - Parse Redpanda Connect templates and report any linting errors
USAGE:
redpanda-connect template lint [command options]
DESCRIPTION:
Exits with a status code 1 if any linting errors are detected:
redpanda-connect template lint
redpanda-connect template lint ./templates/*.yaml
redpanda-connect template lint ./foo.yaml ./bar.yaml
redpanda-connect template lint ./templates/...
If a path ends with '...' then Redpanda Connect will walk the target and lint any
files with the .yaml or .yml extension.
OPTIONS:
--env-file value, -e value [ --env-file value, -e value ] import environment variables from a dotenv file
--templates value, -t value [ --templates value, -t value ] EXPERIMENTAL: import Redpanda Connect templates, supports glob patterns (requires quotes)
--help, -h show help
based on this, this option is valid redpanda-connect template lint that does nothing (?)
and since there is an option -t I made a mistake and I did not add the templates files as an argument of template lint and it give me a false positive
for instance, if the template is ok, both commands exit with success
$ docker run --rm -v ./templates:/t redpandadata/connect:4.42 template lint -t "/t/*.yaml"
$ docker run --rm -v ./templates:/t redpandadata/connect:4.42 template lint "/t/*.yaml"
however, if I change one unit test to force a failure, the first command will not execute the unit tests.
what I expect: same behavior as test
$ docker run --rm -v ./config:/c redpandadata/connect:4.42 test
No tests were found
$ echo $?
1
BTW the command lint also return a false positive if no files are specified (and the help description does not show this possibility
$ docker run --rm -v ./config:/c redpandadata/connect:4.42 lint
$ echo $?
0
$ docker run --rm -v ./config:/c redpandadata/connect:4.42 lint help
NAME:
redpanda-connect lint - Parse Redpanda Connect configs and report any linting errors
USAGE:
redpanda-connect lint [command options]
DESCRIPTION:
Exits with a status code 1 if any linting errors are detected:
redpanda-connect lint ./configs/*.yaml
redpanda-connect lint ./foo.yaml ./bar.yaml
redpanda-connect lint ./configs/...
If a path ends with '...' then Redpanda Connect will walk the target and lint any
files with the .yaml or .yml extension.
what I expect:
- if I call test, lint or template lint, I expect a failure message and exit code != 0 if no files are specified (it could be a mistake)
- will be wonderful some kind of "verbose" option where we show the files linted /tested and what are the tests executed
Regards
- Dominant language
- Go
- Stars
- 571
- Forks
- 121
- Avg merge
- 1d 13h
- Merged PRs (30d)
- 15
Getting set up
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from redpanda-data/benthos
-
Difficulty 2/5 1-3 hours Newbie friendliness 62/100
redpanda-data/benthos#404 ·
Maintainers usually reply within 1 day
-
Difficulty 3/5 1-2 days Newbie friendliness 68/100
redpanda-data/benthos#503 ·
Maintainers usually reply within 1 day
-
Difficulty 4/5 3-5 days Newbie friendliness 55/100
redpanda-data/benthos#502 ·
Maintainers usually reply within 1 day
-
Difficulty 4/5 3-5 days Newbie friendliness 72/100
redpanda-data/benthos#481 ·
Maintainers usually reply within 1 day
-
Difficulty 3/5 1-2 days Newbie friendliness 72/100
redpanda-data/benthos#469 ·
Maintainers usually reply within 1 day
All issues in redpanda-data/benthos
Similar issues
-
bug
Difficulty 1/5 Under an hour Newbie friendliness 92/100
open-telemetry/opentelemetry-go-compile-instrumentation#1417 ·
Maintainers usually reply within 2 days
-
agent-research-finding agent-research-recommend chore ready-for-agent
Difficulty 2/5 1-3 hours Newbie friendliness 85/100
jordansmall/spindrift#4068 · 1 comment ·
Maintainers usually reply within 1 day
-
Type/Task
Difficulty 2/5 1-3 hours Newbie friendliness 74/100
OpenNSW/nsw-srilanka#537 ·
Maintainers usually reply within 1 day
-
security
Difficulty 2/5 1-2 days Newbie friendliness 62/100
-
Difficulty 2/5 1-3 hours Newbie friendliness 90/100
Maintainers usually reply within 1 day