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

UI5 linter does not report findings with given file path pattern #355

Open
flovogt opened this issue Oct 9, 2024 · 2 comments · May be fixed by #367
Open

UI5 linter does not report findings with given file path pattern #355

flovogt opened this issue Oct 9, 2024 · 2 comments · May be fixed by #367
Assignees
Labels
bug Something isn't working

Comments

@flovogt
Copy link
Member

flovogt commented Oct 9, 2024

Expected Behavior

When executing ui5lint with a specified file path pattern, it should report findings the same findings as the linter would detect when executed in the specified directory.

ui5lint my/path/* and (cd my/path/ && ui5lint) should report the same results.

Current Behavior

ui5lint test/sap/ui/core/demokit/tutorial/mockserver/01/* shows an error

Error Message:
Specified file patterns 'test/sap/ui/core/demokit/tutorial/mockserver/01/Component.js', 'test/sap/ui/core/demokit/tutorial/mockserver/01/manifest.json', 'test/sap/ui/core/demokit/tutorial/mockserver/01/package.json', 'test/sap/ui/core/demokit/tutorial/mockserver/01/ui5.yaml', 'test/sap/ui/core/demokit/tutorial/mockserver/01/webapp' did not match any resource

Steps to Reproduce the Issue

  1. Checkout https://github.com/SAP/openui5 and navigate to folder src/sap.ui.core/
  2. Execute ui5lint test/sap/ui/core/demokit/tutorial/mockserver/01/*
  3. The reported error is shown
  4. When navigating to the folder and execute (cd test/sap/ui/core/demokit/tutorial/mockserver/01/* ui5lint) the findings are correctly reported

Context

  • UI5 linter version: v1.0.1
  • Node.js Version: v22.9.0
  • npm Version: v10.8.9
  • OS/Platform: macos15
@flovogt flovogt added the bug Something isn't working label Oct 9, 2024
@matz3 matz3 self-assigned this Oct 16, 2024
@matz3
Copy link
Member

matz3 commented Oct 17, 2024

Short update on this one. It indeed seems that there are several unexpected limitations on how files can be specified.

  • Specifying a folder without a glob pattern does not lint the contents of that folder
  • Specifying any file/pattern in library projects does not seem to work unless the folder namespace is omitted (i.e. src/library.js)
  • Invoking the CLI in a sub-folder of a project is currently not supported at all

@d3xter666 d3xter666 linked a pull request Oct 17, 2024 that will close this issue
@d3xter666 d3xter666 self-assigned this Oct 17, 2024
@matz3 matz3 removed their assignment Oct 18, 2024
@d3xter666
Copy link
Contributor

d3xter666 commented Oct 18, 2024

Just a note: The case described in the issue is rather special and we need to make it clear that there will be certain limitations and exceptions. The test/sap/ui/core/demokit/tutorial/mockserver/01/ path in sap.ui.core is a project itself within the sap.ui.core library (main project).
The results in such case would indeed differ when the user lints the project from sap.ui.core or CDs into test/sap/ui/core/demokit/tutorial/mockserver/01/.
The reason is that the linter searches for certain files like ui5.yaml only in the root folder of the project. And in the case of linting from sap.ui.core, the root would be sap.ui.core and ui5.yaml in test/sap/ui/core/demokit/tutorial/mockserver/01/ would be skipped

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

Successfully merging a pull request may close this issue.

3 participants