SAP / ui5-linter

A static code analysis tool for UI5
Apache License 2.0
47 stars 4 forks source link

Option to specify the source folder #154

Closed xLexip closed 2 months ago

xLexip commented 3 months ago

Is your feature request related to a problem? Please describe.

Our source folder is called app instead of webapp. Therefore, we cannot use the ui5-linter.

Even with a direct file path, ui5-linter refuses to lint the file:

ui5lint --details --file-paths /home/xxx/dev/project/app/folder123/business-objects/business-objects.controller.js Error Message: File path /home/xxx/dev/project/app/folder123/business-objects/business-objects.controller.js is not located within the detected source or test directories of the project

Describe the solution you'd like

There should be an option to specify the source directory. Or at least a way to forcefully lint a file using a direct file path without being patronized by the ui5-linter.

matz3 commented 3 months ago

You should be able to workaround this issue by creating an ui5.yaml configuration file in /home/xxx/dev/project (parent of the app folder) and specifying the alternative webapp folder name in there:

specVersion: '3.2'
metadata:
  name: app
type: application
resources:
  configuration:
    paths:
      webapp: app

In general, UI5 linter is intended to work with most projects out of the box without the need for a ui5.yaml or usage of UI5 Tooling. However, this only applies when the expected folder structure (webapp for applications, src / test for libraries) is used. Beyond that, we recommend to create a ui5.yaml configuration as outlined above to make use of UI5 linter.

xLexip commented 3 months ago

I will try that, thank you.

matz3 commented 2 months ago

@xLexip did my proposal work for you?

xLexip commented 2 months ago

@matz3 it did, thanks.