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

Error when using file-paths together with subfolder #259

Closed
marianfoo opened this issue Aug 14, 2024 · 2 comments
Closed

Error when using file-paths together with subfolder #259

marianfoo opened this issue Aug 14, 2024 · 2 comments
Assignees
Labels
bug Something isn't working

Comments

@marianfoo
Copy link
Contributor

marianfoo commented Aug 14, 2024

Expected Behavior

Using file-paths and wildcards would check the folder plus all subfolders

Current Behavior

ui5-linter errors out because logic thinks subfolder is a file.
Using this cli command: ui5lint --file-paths webapp/controller/* webapp/model/* webapp/view/*

And this folder structure:
image

Works without file-paths.
I´d rather use something to exclude folders or filepaths but currently i have to include all the folders i would like to test.
It would be much easier to just exclude the test folder.
In a CI pipeline i need a either it´s all good or not. Doing it manually is no problem, i can just ignore it.

Steps to Reproduce the Issue

git clone https://github.com/marianfoo/ui5linterbug
cd ui5linterbug
npm i
npm run lint

Context

  • UI5 linter version: 0.3.2
  • Node.js Version: 20.14.0
  • npm Version: 10.3.0
  • OS/Platform: Mac

Log Output / Stack Trace

npm run lint -- --verbose

> [email protected] lint
> ui5lint --file-paths webapp/controller/* webapp/model/* webapp/view/* --verbose

verb cli:middlewares:base using ui5lint version 0.3.2 (from /Users/marianzeis/DEV/ui5linterbug/node_modules/@ui5/linter/bin/ui5lint.js)
verb cli:middlewares:base using node version v20.14.0
verb generateProjectGraph Creating project graph using object...
verb graph:Module Could not find any build manifest in module ui5-linter-target
verb graph:Module Configuration for module ui5-linter-target is provided in YAML file at /Users/marianzeis/DEV/ui5linterbug/ui5.yaml
verb specifications:types:Application Path mapping for application project com.myorg.myapp:
verb specifications:types:Application   Physical root path: /Users/marianzeis/DEV/ui5linterbug
verb specifications:types:Application   Mapped to: webapp
verb specifications:types:Application Namespace of project com.myorg.myapp is com/myorg/myapp (from manifest.json)
verb graph:Module Module ui5-linter-target contains project com.myorg.myapp
verb graph:projectGraphBuilder Root project com.myorg.myapp qualified as application project for project graph
verb graph:ProjectGraph Adding project: com.myorg.myapp
verb graph:ProjectGraph Skipping resolution of optional dependencies since none have been declared
perf Trace Project Graph creation took 112.17 ms
perf Trace Linting manifest.json files took 0.15 ms
perf Trace XML Transpiler initialization took 0.95 ms
perf Trace Transpile XML took 16.31 ms - /resources/com/myorg/myapp/view/Main.view.xml
perf Trace Transpile XML took 17.15 ms - /resources/com/myorg/myapp/view/App.view.xml

⚠️  Process Failed With Error

Error Message:
File not found: /resources/com/myorg/myapp/controller/subfolder.ts

Stack Trace:
Error: File not found: /resources/com/myorg/myapp/controller/subfolder.ts
    at Object.getSourceFile (file:///Users/marianzeis/DEV/ui5linterbug/node_modules/@ui5/linter/lib/linter/ui5Types/host.js:188:23)
    at findSourceFileWorker (/Users/marianzeis/DEV/ui5linterbug/node_modules/@ui5/linter/node_modules/typescript/lib/typescript.js:125889:23)
    at findSourceFile (/Users/marianzeis/DEV/ui5linterbug/node_modules/@ui5/linter/node_modules/typescript/lib/typescript.js:125805:20)
    at /Users/marianzeis/DEV/ui5linterbug/node_modules/@ui5/linter/node_modules/typescript/lib/typescript.js:125754:22
    at /Users/marianzeis/DEV/ui5linterbug/node_modules/@ui5/linter/node_modules/typescript/lib/typescript.js:125746:91
    at forEach (/Users/marianzeis/DEV/ui5linterbug/node_modules/@ui5/linter/node_modules/typescript/lib/typescript.js:2388:22)
    at getSourceFileFromReferenceWorker (/Users/marianzeis/DEV/ui5linterbug/node_modules/@ui5/linter/node_modules/typescript/lib/typescript.js:125746:44)
    at processSourceFile (/Users/marianzeis/DEV/ui5linterbug/node_modules/@ui5/linter/node_modules/typescript/lib/typescript.js:125752:5)
    at processRootFile (/Users/marianzeis/DEV/ui5linterbug/node_modules/@ui5/linter/node_modules/typescript/lib/typescript.js:125544:5)
    at /Users/marianzeis/DEV/ui5linterbug/node_modules/@ui5/linter/node_modules/typescript/lib/typescript.js:124269:41
@marianfoo marianfoo added the bug Something isn't working label Aug 14, 2024
@flovogt flovogt self-assigned this Aug 15, 2024
@flovogt
Copy link
Member

flovogt commented Sep 23, 2024

@marianfoo thanks for reporting this issue. We will fix this bug in backlog item CPOUI5FOUNDATION-881.

@flovogt
Copy link
Member

flovogt commented Oct 2, 2024

Fixed with #312

@flovogt flovogt closed this as completed Oct 2, 2024
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