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

linter ignores ignore-pattern #407

Open
ehwg opened this issue Nov 13, 2024 · 2 comments
Open

linter ignores ignore-pattern #407

ehwg opened this issue Nov 13, 2024 · 2 comments
Assignees
Labels
bug Something isn't working

Comments

@ehwg
Copy link

ehwg commented Nov 13, 2024

Expected Behavior

When I run npm run ui5-lint --ignore-pattern "webapp/test/locate-reuse-libs.js" > ui5linter.txt I would expect to get everything except the reuse-libs

In the log I see.

> [email protected] ui5-lint
> ui5lint --format markdown webapp/test/locate-reuse-libs.js

# UI5 linter Report
## Summary

...

# UI5 linter Report
## Summary

> nn problems (nn errors, 0 warnings)  

## Findings
### webapp\test\locate-reuse-libs.js

| Severity | Line | Message |
|----------|------|---------|
| Error | `62:13` | Access of globXXXXX |

Current Behavior

I get only the results for the reuse lib:

Steps to Reproduce the Issue

You can run the command mentioned above

Context

  • UI5 linter version: latest
  • Node.js version: v22.8.0
  • npm version: v10.8.2
  • OS/Platform: windows
  • Other information regarding your environment (optional): nothing

Log Output / Stack Trace

There is nothing additionally in the verbose mode.
@ehwg ehwg added the bug Something isn't working label Nov 13, 2024
@matz3
Copy link
Member

matz3 commented Nov 13, 2024

Could you please share the content of your ui5-lint script in the package.json?

To me this seems to be caused by the missing separation of arguments when using npm run, see https://docs.npmjs.com/cli/v7/commands/npm-run-script#description

In that case, the correct command would be npm run ui5-lint -- --ignore-pattern "webapp/test/locate-reuse-libs.js" > ui5linter.txt

@matz3 matz3 self-assigned this Nov 13, 2024
@matz3
Copy link
Member

matz3 commented Nov 15, 2024

Update on this one:

We were able to get the file redirect working. Worth noting is that when using the default text formatter, the output is printed into stderr. The file-specific formatters (e.g. json or markdown) print to stdout.

One issue that still remained was that not all references of a file to be ignored via --ignore-pattern were working as expected. --ignore-pattern "webapp/test/locate-reuse-libs.js" works, but --ignore-pattern "./webapp/test/locate-reuse-libs.js" did not work. This was reproducible in Git Bash on Windows.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants