Adalennis opened a new issue, #9387:
URL: https://github.com/apache/hop/issues/9387
### Apache Hop version?
2.20.0
### Java version?
Java 21
### Operating system
macOS
### What happened?
Reproduced on 2.20.0 with the lint plugin 2.20.0; the code involved is
unchanged on main.
When a project has no `hop-lint.yml`, `RuleRegistry.findProjectYaml()` walks
up from the linted file through every parent folder to the root of the file
system, and uses the first `hop-lint.yml` it finds. The folder where it finds
it also becomes the root for `exclude` and `suppress` paths
(`HopLinter.projectRootFor()`).
The Linting page ("Configuring a project") only says "Put a `hop-lint.yml`
in the project root". A comment in `HopLinter` lists "hop-lint.yml in parent
directories of the project" as a source, so looking in parent folders seems
intended, but leaving the project doesn't seem to be.
Steps, with a copy of the samples project in `/work/samples`, which has no
`hop-lint.yml`:
1. `hop lint -j samples
/work/samples/transforms/languagemodelchat/zero-shot/openai.hpl`: 3 errors,
exit 1.
2. Put a `hop-lint.yml` in `/work` (outside the project) with `rules:
SEC-002: enabled: false`. The same command: 0 errors, exit 0.
3. Replace it with `exclude: ["transforms/languagemodelchat/**"]`, a path
relative to the project: the file is still linted. With `exclude:
["samples/transforms/languagemodelchat/**"]`, relative to `/work`: the file is
excluded.
So a `hop-lint.yml` left in a home folder or a workspace folder silently
changes the result for every project below it, and a CI checkout may lint
differently from a developer's machine.
### Issue Priority
Priority: 3
### Issue Component
Component: Other
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]