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

feat: Add new output format markdown #258

Merged
merged 4 commits into from
Aug 27, 2024

Conversation

marianfoo
Copy link
Contributor

@marianfoo marianfoo commented Aug 13, 2024

fix #178

Added new markdown option for output as suggested in the issue.

Added tests for output.

Here is a sample output with ui5lint --format markdown --details:

Markdown output sample

UI5 Linter Report

/Users/marianzeis/DEV//webapp/control/DynamicCompartmentBox.ts

  • 🔴 [81:7] Call to deprecated function 'writeControlData' of class 'RenderManager'
  • 🔴 [104:9] Call to deprecated function 'write' of class 'RenderManager'
    • Details: (since 1.92) - Instead, use the Semantic Rendering API (https://ui5.sap.com/1.120/#/api/sap.ui.core.RenderManager). There is no 1:1 replacement for write. Typically, write is used to create a longer sequence of HTML markup (e.g. an element with attributes and children) in a single call. Such a markup sequence has to be split into the individual calls of the Semantic Rendering API.
  • 🔴 [108:9] Call to deprecated function 'write' of class 'RenderManager'
    • Details: (since 1.92) - Instead, use the Semantic Rendering API (https://ui5.sap.com/1.120/#/api/sap.ui.core.RenderManager). There is no 1:1 replacement for write. Typically, write is used to create a longer sequence of HTML markup (e.g. an element with attributes and children) in a single call. Such a markup sequence has to be split into the individual calls of the Semantic Rendering API.
  • 🔴 [129:7] Call to deprecated function 'write' of class 'RenderManager'
    • Details: (since 1.92) - Instead, use the Semantic Rendering API (https://ui5.sap.com/1.120/#/api/sap.ui.core.RenderManager). There is no 1:1 replacement for write. Typically, write is used to create a longer sequence of HTML markup (e.g. an element with attributes and children) in a single call. Such a markup sequence has to be split into the individual calls of the Semantic Rendering API.

/Users/marianzeis/DEV//webapp/control/DynamicCompartmentBoxItem.ts

  • 🔴 [142:12] Call to deprecated function 'write' of class 'RenderManager'
    • Details: (since 1.92) - Instead, use the Semantic Rendering API (https://ui5.sap.com/1.120/#/api/sap.ui.core.RenderManager). There is no 1:1 replacement for write. Typically, write is used to create a longer sequence of HTML markup (e.g. an element with attributes and children) in a single call. Such a markup sequence has to be split into the individual calls of the Semantic Rendering API.
  • 🔴 [147:12] Call to deprecated function 'writeControlData' of class 'RenderManager'
  • 🔴 [167:16] Call to deprecated function 'write' of class 'RenderManager'
    • Details: (since 1.92) - Instead, use the Semantic Rendering API (https://ui5.sap.com/1.120/#/api/sap.ui.core.RenderManager). There is no 1:1 replacement for write. Typically, write is used to create a longer sequence of HTML markup (e.g. an element with attributes and children) in a single call. Such a markup sequence has to be split into the individual calls of the Semantic Rendering API.
  • 🔴 [173:16] Call to deprecated function 'write' of class 'RenderManager'
    • Details: (since 1.92) - Instead, use the Semantic Rendering API (https://ui5.sap.com/1.120/#/api/sap.ui.core.RenderManager). There is no 1:1 replacement for write. Typically, write is used to create a longer sequence of HTML markup (e.g. an element with attributes and children) in a single call. Such a markup sequence has to be split into the individual calls of the Semantic Rendering API.

/Users/marianzeis/DEV//webapp/localService/mockserver.js

  • 🔴 [16:34] Use of deprecated API 'jQuery.sap.getUriParameters'
    • Details: since 1.58. To avoid usage of global variables in general, please do not use the jQuery.sap namespace any longer. Most of the jQuery.sap functionalities are replaced by alternative modules which can be found in the API doc.
  • 🔴 [17:33] Use of deprecated API 'jQuery.sap.getModulePath'
    • Details: since 1.58. To avoid usage of global variables in general, please do not use the jQuery.sap namespace any longer. Most of the jQuery.sap functionalities are replaced by alternative modules which can be found in the API doc.
  • 🔴 [18:32] Use of deprecated API 'jQuery.sap.getModulePath'
    • Details: since 1.58. To avoid usage of global variables in general, please do not use the jQuery.sap namespace any longer. Most of the jQuery.sap functionalities are replaced by alternative modules which can be found in the API doc.
  • 🔴 [22:29] Use of deprecated API 'jQuery.sap.syncGetJSON'
    • Details: since 1.58. To avoid usage of global variables in general, please do not use the jQuery.sap namespace any longer. Most of the jQuery.sap functionalities are replaced by alternative modules which can be found in the API doc.
  • 🔴 [25:32] Use of deprecated API 'jQuery.sap.getModulePath'
    • Details: since 1.58. To avoid usage of global variables in general, please do not use the jQuery.sap namespace any longer. Most of the jQuery.sap functionalities are replaced by alternative modules which can be found in the API doc.
  • 🔴 [81:13] Use of deprecated API 'jQuery.sap.log.info'
    • Details: since 1.58. To avoid usage of global variables in general, please do not use the jQuery.sap namespace any longer. Most of the jQuery.sap functionalities are replaced by alternative modules which can be found in the API doc.
  • 🔴 [87:37] Use of deprecated API 'jQuery.sap.getModulePath'
    • Details: since 1.58. To avoid usage of global variables in general, please do not use the jQuery.sap namespace any longer. Most of the jQuery.sap functionalities are replaced by alternative modules which can be found in the API doc.
  • 🔴 [100:37] Use of deprecated API 'jQuery.sap.require'
    • Details: since 1.58. To avoid usage of global variables in general, please do not use the jQuery.sap namespace any longer. Most of the jQuery.sap functionalities are replaced by alternative modules which can be found in the API doc.
  • 🔴 [102:56] Use of deprecated API 'jQuery.sap.sjax'
    • Details: since 1.58. To avoid usage of global variables in general, please do not use the jQuery.sap namespace any longer. Most of the jQuery.sap functionalities are replaced by alternative modules which can be found in the API doc.
  • 🔴 [107:62] Use of deprecated API 'jQuery.sap.serializeXML'
    • Details: since 1.58. To avoid usage of global variables in general, please do not use the jQuery.sap namespace any longer. Most of the jQuery.sap functionalities are replaced by alternative modules which can be found in the API doc.

/Users/marianzeis/DEV//webapp/util/Util.ts

/Users/marianzeis/DEV//webapp/view/Source.view.xml

  • 🔴 [111:37] Use of deprecated property 'useExportToExcel' of class 'SmartTable'
    • Details: (since 1.100) - replaced by enableExport property.
  • 🔴 [143:41] Use of deprecated property 'visibleRowCount' of class 'TreeTable'
    • Details: (since 1.119) - use the rowMode aggregation instead.
  • 🔴 [143:61] Use of deprecated property 'rootLevel' of class 'TreeTable'
    • Details: (since 1.76) - replaced by the rootLevel binding parameter. May not work with all bindings.
  • 🔴 [143:75] Use of deprecated property 'expandFirstLevel' of class 'TreeTable'
    • Details: (since 1.46.3) - replaced by the numberOfExpandedLevels binding parameter. May not work with all bindings.

/Users/marianzeis/DEV//webapp/view/Target.view.xml

  • 🔴 [120:29] Use of deprecated property 'visibleRowCount' of class 'TreeTable'
    • Details: (since 1.119) - use the rowMode aggregation instead.

/Users/marianzeis/DEV//webapp/view/TargetBadHU.view.xml

  • 🔴 [89:17] Use of deprecated property 'visibleRowCount' of class 'Table'
    • Details: (since 1.119) - use the rowMode aggregation instead.

Summary

  • Total problems: 28
    • Errors: 28
    • Warnings: 0
Text output sample
UI5 linter report:

/Users/marianzeis/DEV/<apppath>/webapp/control/DynamicCompartmentBox.ts
   81:7 error Call to deprecated function 'writeControlData' of class 'RenderManager'. Details: (since 1.92) - Instead use sap.ui.core.RenderManager#openStart (https://ui5.sap.com/1.120/#/api/sap.ui.core.RenderManager%23methods/openStart) or sap.ui.core.RenderManager#voidStart (https://ui5.sap.com/1.120/#/api/sap.ui.core.RenderManager%23methods/voidStart) of the Semantic Rendering API (https://ui5.sap.com/1.120/#/api/sap.ui.core.RenderManager) and pass the desired control data as the second parameter to the new API.
  104:9 error Call to deprecated function 'write' of class 'RenderManager'. Details: (since 1.92) - Instead, use the Semantic Rendering API (https://ui5.sap.com/1.120/#/api/sap.ui.core.RenderManager). There is no 1:1 replacement for `write`. Typically, `write` is used to create a longer sequence of HTML markup (e.g. an element with attributes and children) in a single call. Such a markup sequence has to be split into the individual calls of the Semantic Rendering API.
  108:9 error Call to deprecated function 'write' of class 'RenderManager'. Details: (since 1.92) - Instead, use the Semantic Rendering API (https://ui5.sap.com/1.120/#/api/sap.ui.core.RenderManager). There is no 1:1 replacement for `write`. Typically, `write` is used to create a longer sequence of HTML markup (e.g. an element with attributes and children) in a single call. Such a markup sequence has to be split into the individual calls of the Semantic Rendering API.
  129:7 error Call to deprecated function 'write' of class 'RenderManager'. Details: (since 1.92) - Instead, use the Semantic Rendering API (https://ui5.sap.com/1.120/#/api/sap.ui.core.RenderManager). There is no 1:1 replacement for `write`. Typically, `write` is used to create a longer sequence of HTML markup (e.g. an element with attributes and children) in a single call. Such a markup sequence has to be split into the individual calls of the Semantic Rendering API.

/Users/marianzeis/DEV/<apppath>/webapp/control/DynamicCompartmentBoxItem.ts
  142:12 error Call to deprecated function 'write' of class 'RenderManager'. Details: (since 1.92) - Instead, use the Semantic Rendering API (https://ui5.sap.com/1.120/#/api/sap.ui.core.RenderManager). There is no 1:1 replacement for `write`. Typically, `write` is used to create a longer sequence of HTML markup (e.g. an element with attributes and children) in a single call. Such a markup sequence has to be split into the individual calls of the Semantic Rendering API.
  147:12 error Call to deprecated function 'writeControlData' of class 'RenderManager'. Details: (since 1.92) - Instead use sap.ui.core.RenderManager#openStart (https://ui5.sap.com/1.120/#/api/sap.ui.core.RenderManager%23methods/openStart) or sap.ui.core.RenderManager#voidStart (https://ui5.sap.com/1.120/#/api/sap.ui.core.RenderManager%23methods/voidStart) of the Semantic Rendering API (https://ui5.sap.com/1.120/#/api/sap.ui.core.RenderManager) and pass the desired control data as the second parameter to the new API.
  167:16 error Call to deprecated function 'write' of class 'RenderManager'. Details: (since 1.92) - Instead, use the Semantic Rendering API (https://ui5.sap.com/1.120/#/api/sap.ui.core.RenderManager). There is no 1:1 replacement for `write`. Typically, `write` is used to create a longer sequence of HTML markup (e.g. an element with attributes and children) in a single call. Such a markup sequence has to be split into the individual calls of the Semantic Rendering API.
  173:16 error Call to deprecated function 'write' of class 'RenderManager'. Details: (since 1.92) - Instead, use the Semantic Rendering API (https://ui5.sap.com/1.120/#/api/sap.ui.core.RenderManager). There is no 1:1 replacement for `write`. Typically, `write` is used to create a longer sequence of HTML markup (e.g. an element with attributes and children) in a single call. Such a markup sequence has to be split into the individual calls of the Semantic Rendering API.

/Users/marianzeis/DEV/<apppath>/webapp/localService/mockserver.js
   16:34 error Use of deprecated API 'jQuery.sap.getUriParameters'. Details: since 1.58. To avoid usage of global variables in general, please do not use the jQuery.sap namespace any longer. Most of the jQuery.sap functionalities are replaced by alternative modules which can be found in the API doc.
   17:33 error Use of deprecated API 'jQuery.sap.getModulePath'. Details: since 1.58. To avoid usage of global variables in general, please do not use the jQuery.sap namespace any longer. Most of the jQuery.sap functionalities are replaced by alternative modules which can be found in the API doc.
   18:32 error Use of deprecated API 'jQuery.sap.getModulePath'. Details: since 1.58. To avoid usage of global variables in general, please do not use the jQuery.sap namespace any longer. Most of the jQuery.sap functionalities are replaced by alternative modules which can be found in the API doc.
   22:29 error Use of deprecated API 'jQuery.sap.syncGetJSON'. Details: since 1.58. To avoid usage of global variables in general, please do not use the jQuery.sap namespace any longer. Most of the jQuery.sap functionalities are replaced by alternative modules which can be found in the API doc.
   25:32 error Use of deprecated API 'jQuery.sap.getModulePath'. Details: since 1.58. To avoid usage of global variables in general, please do not use the jQuery.sap namespace any longer. Most of the jQuery.sap functionalities are replaced by alternative modules which can be found in the API doc.
   81:13 error Use of deprecated API 'jQuery.sap.log.info'. Details: since 1.58. To avoid usage of global variables in general, please do not use the jQuery.sap namespace any longer. Most of the jQuery.sap functionalities are replaced by alternative modules which can be found in the API doc.
   87:37 error Use of deprecated API 'jQuery.sap.getModulePath'. Details: since 1.58. To avoid usage of global variables in general, please do not use the jQuery.sap namespace any longer. Most of the jQuery.sap functionalities are replaced by alternative modules which can be found in the API doc.
  100:37 error Use of deprecated API 'jQuery.sap.require'. Details: since 1.58. To avoid usage of global variables in general, please do not use the jQuery.sap namespace any longer. Most of the jQuery.sap functionalities are replaced by alternative modules which can be found in the API doc.
  102:56 error Use of deprecated API 'jQuery.sap.sjax'. Details: since 1.58. To avoid usage of global variables in general, please do not use the jQuery.sap namespace any longer. Most of the jQuery.sap functionalities are replaced by alternative modules which can be found in the API doc.
  107:62 error Use of deprecated API 'jQuery.sap.serializeXML'. Details: since 1.58. To avoid usage of global variables in general, please do not use the jQuery.sap namespace any longer. Most of the jQuery.sap functionalities are replaced by alternative modules which can be found in the API doc.

/Users/marianzeis/DEV/<apppath>/webapp/util/Util.ts
  24:23 error Access of global variable 'sap' (sap.ui.getCore)
  24:30 error Call to deprecated function 'getCore' (sap.ui.getCore). Details: (since 1.118) - Please require 'sap/ui/core/Core' instead and use the module export directly without using 'new'."
  24:40 error Call to deprecated function 'getConfiguration' of class 'Core'. Details: (since 1.120) - Please see Configuration (https://ui5.sap.com/1.120/#/api/sap.ui.core.Configuration) for the corrsponding replacements.
  24:59 error Call to deprecated function 'getLanguage' of class 'Configuration'. Details: (since 1.119) - Please use Localization.getLanguage (https://ui5.sap.com/1.120/#/api/module:sap/base/i18n/Localization%23methods/sap/base/i18n/Localization.getLanguage)instead.

/Users/marianzeis/DEV/<apppath>/webapp/view/Source.view.xml
  111:37 error Use of deprecated property 'useExportToExcel' of class 'SmartTable'. Details: (since 1.100) - replaced by `enableExport` property.
  143:41 error Use of deprecated property 'visibleRowCount' of class 'TreeTable'. Details: (since 1.119) - use the `rowMode` aggregation instead.
  143:61 error Use of deprecated property 'rootLevel' of class 'TreeTable'. Details: (since 1.76) - replaced by the `rootLevel` binding parameter. May not work with all bindings.
  143:75 error Use of deprecated property 'expandFirstLevel' of class 'TreeTable'. Details: (since 1.46.3) - replaced by the `numberOfExpandedLevels` binding parameter. May not work with all bindings.

/Users/marianzeis/DEV/<apppath>/webapp/view/Target.view.xml
  120:29 error Use of deprecated property 'visibleRowCount' of class 'TreeTable'. Details: (since 1.119) - use the `rowMode` aggregation instead.

/Users/marianzeis/DEV/<apppath>/webapp/view/TargetBadHU.view.xml
  89:17 error Use of deprecated property 'visibleRowCount' of class 'Table'. Details: (since 1.119) - use the `rowMode` aggregation instead.

28 problems (28 errors, 0 warnings)
JSON output sample
[
   {
      "filePath": "webapp/util/Util.ts",
      "messages": [
         {
            "ruleId": "ui5-linter-no-deprecated-api",
            "severity": 2,
            "line": 24,
            "column": 59,
            "message": "Call to deprecated function 'getLanguage' of class 'Configuration'",
            "messageDetails": "(since 1.119) - Please use Localization.getLanguage (https://ui5.sap.com/1.120/#/api/module:sap/base/i18n/Localization%23methods/sap/base/i18n/Localization.getLanguage)instead."
         },
         {
            "ruleId": "ui5-linter-no-deprecated-api",
            "severity": 2,
            "line": 24,
            "column": 40,
            "message": "Call to deprecated function 'getConfiguration' of class 'Core'",
            "messageDetails": "(since 1.120) - Please see Configuration (https://ui5.sap.com/1.120/#/api/sap.ui.core.Configuration) for the corrsponding\nreplacements."
         },
         {
            "ruleId": "ui5-linter-no-deprecated-api",
            "severity": 2,
            "line": 24,
            "column": 30,
            "message": "Call to deprecated function 'getCore' (sap.ui.getCore)",
            "messageDetails": "(since 1.118) - Please require 'sap/ui/core/Core' instead and use the module export directly\nwithout using 'new'.\""
         },
         {
            "ruleId": "ui5-linter-no-globals-js",
            "severity": 2,
            "line": 24,
            "column": 23,
            "message": "Access of global variable 'sap' (sap.ui.getCore)"
         }
      ],
      "errorCount": 4,
      "warningCount": 0,
      "fatalErrorCount": 0
   },
   {
      "filePath": "webapp/view/TargetBadHU.view.xml",
      "messages": [
         {
            "ruleId": "ui5-linter-no-deprecated-api",
            "severity": 2,
            "line": 89,
            "column": 17,
            "message": "Use of deprecated property 'visibleRowCount' of class 'Table'",
            "messageDetails": "(since 1.119) - use the `rowMode` aggregation instead."
         }
      ],
      "errorCount": 1,
      "warningCount": 0,
      "fatalErrorCount": 0
   },
   {
      "filePath": "webapp/view/Target.view.xml",
      "messages": [
         {
            "ruleId": "ui5-linter-no-deprecated-api",
            "severity": 2,
            "line": 120,
            "column": 29,
            "message": "Use of deprecated property 'visibleRowCount' of class 'TreeTable'",
            "messageDetails": "(since 1.119) - use the `rowMode` aggregation instead."
         }
      ],
      "errorCount": 1,
      "warningCount": 0,
      "fatalErrorCount": 0
   },
   {
      "filePath": "webapp/view/Source.view.xml",
      "messages": [
         {
            "ruleId": "ui5-linter-no-deprecated-api",
            "severity": 2,
            "line": 143,
            "column": 41,
            "message": "Use of deprecated property 'visibleRowCount' of class 'TreeTable'",
            "messageDetails": "(since 1.119) - use the `rowMode` aggregation instead."
         },
         {
            "ruleId": "ui5-linter-no-deprecated-api",
            "severity": 2,
            "line": 143,
            "column": 61,
            "message": "Use of deprecated property 'rootLevel' of class 'TreeTable'",
            "messageDetails": "(since 1.76) - replaced by the `rootLevel` binding parameter. May not work with all bindings."
         },
         {
            "ruleId": "ui5-linter-no-deprecated-api",
            "severity": 2,
            "line": 143,
            "column": 75,
            "message": "Use of deprecated property 'expandFirstLevel' of class 'TreeTable'",
            "messageDetails": "(since 1.46.3) - replaced by the `numberOfExpandedLevels` binding parameter. May not work\nwith all bindings."
         },
         {
            "ruleId": "ui5-linter-no-deprecated-api",
            "severity": 2,
            "line": 111,
            "column": 37,
            "message": "Use of deprecated property 'useExportToExcel' of class 'SmartTable'",
            "messageDetails": "(since 1.100) - replaced by `enableExport` property."
         }
      ],
      "errorCount": 4,
      "warningCount": 0,
      "fatalErrorCount": 0
   },
   {
      "filePath": "webapp/localService/mockserver.js",
      "messages": [
         {
            "ruleId": "ui5-linter-no-deprecated-api",
            "severity": 2,
            "line": 16,
            "column": 34,
            "message": "Use of deprecated API 'jQuery.sap.getUriParameters'",
            "messageDetails": "since 1.58. To avoid usage of global variables in general, please\ndo not use the jQuery.sap namespace any longer. Most of the jQuery.sap functionalities\nare replaced by alternative modules which can be found in the API doc."
         },
         {
            "ruleId": "ui5-linter-no-deprecated-api",
            "severity": 2,
            "line": 17,
            "column": 33,
            "message": "Use of deprecated API 'jQuery.sap.getModulePath'",
            "messageDetails": "since 1.58. To avoid usage of global variables in general, please\ndo not use the jQuery.sap namespace any longer. Most of the jQuery.sap functionalities\nare replaced by alternative modules which can be found in the API doc."
         },
         {
            "ruleId": "ui5-linter-no-deprecated-api",
            "severity": 2,
            "line": 18,
            "column": 32,
            "message": "Use of deprecated API 'jQuery.sap.getModulePath'",
            "messageDetails": "since 1.58. To avoid usage of global variables in general, please\ndo not use the jQuery.sap namespace any longer. Most of the jQuery.sap functionalities\nare replaced by alternative modules which can be found in the API doc."
         },
         {
            "ruleId": "ui5-linter-no-deprecated-api",
            "severity": 2,
            "line": 22,
            "column": 29,
            "message": "Use of deprecated API 'jQuery.sap.syncGetJSON'",
            "messageDetails": "since 1.58. To avoid usage of global variables in general, please\ndo not use the jQuery.sap namespace any longer. Most of the jQuery.sap functionalities\nare replaced by alternative modules which can be found in the API doc."
         },
         {
            "ruleId": "ui5-linter-no-deprecated-api",
            "severity": 2,
            "line": 25,
            "column": 32,
            "message": "Use of deprecated API 'jQuery.sap.getModulePath'",
            "messageDetails": "since 1.58. To avoid usage of global variables in general, please\ndo not use the jQuery.sap namespace any longer. Most of the jQuery.sap functionalities\nare replaced by alternative modules which can be found in the API doc."
         },
         {
            "ruleId": "ui5-linter-no-deprecated-api",
            "severity": 2,
            "line": 81,
            "column": 13,
            "message": "Use of deprecated API 'jQuery.sap.log.info'",
            "messageDetails": "since 1.58. To avoid usage of global variables in general, please\ndo not use the jQuery.sap namespace any longer. Most of the jQuery.sap functionalities\nare replaced by alternative modules which can be found in the API doc."
         },
         {
            "ruleId": "ui5-linter-no-deprecated-api",
            "severity": 2,
            "line": 87,
            "column": 37,
            "message": "Use of deprecated API 'jQuery.sap.getModulePath'",
            "messageDetails": "since 1.58. To avoid usage of global variables in general, please\ndo not use the jQuery.sap namespace any longer. Most of the jQuery.sap functionalities\nare replaced by alternative modules which can be found in the API doc."
         },
         {
            "ruleId": "ui5-linter-no-deprecated-api",
            "severity": 2,
            "line": 100,
            "column": 37,
            "message": "Use of deprecated API 'jQuery.sap.require'",
            "messageDetails": "since 1.58. To avoid usage of global variables in general, please\ndo not use the jQuery.sap namespace any longer. Most of the jQuery.sap functionalities\nare replaced by alternative modules which can be found in the API doc."
         },
         {
            "ruleId": "ui5-linter-no-deprecated-api",
            "severity": 2,
            "line": 102,
            "column": 56,
            "message": "Use of deprecated API 'jQuery.sap.sjax'",
            "messageDetails": "since 1.58. To avoid usage of global variables in general, please\ndo not use the jQuery.sap namespace any longer. Most of the jQuery.sap functionalities\nare replaced by alternative modules which can be found in the API doc."
         },
         {
            "ruleId": "ui5-linter-no-deprecated-api",
            "severity": 2,
            "line": 107,
            "column": 62,
            "message": "Use of deprecated API 'jQuery.sap.serializeXML'",
            "messageDetails": "since 1.58. To avoid usage of global variables in general, please\ndo not use the jQuery.sap namespace any longer. Most of the jQuery.sap functionalities\nare replaced by alternative modules which can be found in the API doc."
         }
      ],
      "errorCount": 10,
      "warningCount": 0,
      "fatalErrorCount": 0
   },
   {
      "filePath": "webapp/control/DynamicCompartmentBoxItem.ts",
      "messages": [
         {
            "ruleId": "ui5-linter-no-deprecated-api",
            "severity": 2,
            "line": 142,
            "column": 12,
            "message": "Call to deprecated function 'write' of class 'RenderManager'",
            "messageDetails": "(since 1.92) - Instead, use the Semantic Rendering API (https://ui5.sap.com/1.120/#/api/sap.ui.core.RenderManager).\nThere is no 1:1 replacement for `write`. Typically, `write` is used to create a longer sequence of HTML\nmarkup (e.g. an element with attributes and children) in a single call. Such a markup sequence has to\nbe split into the individual calls of the Semantic Rendering API."
         },
         {
            "ruleId": "ui5-linter-no-deprecated-api",
            "severity": 2,
            "line": 147,
            "column": 12,
            "message": "Call to deprecated function 'writeControlData' of class 'RenderManager'",
            "messageDetails": "(since 1.92) - Instead use sap.ui.core.RenderManager#openStart (https://ui5.sap.com/1.120/#/api/sap.ui.core.RenderManager%23methods/openStart) or sap.ui.core.RenderManager#voidStart (https://ui5.sap.com/1.120/#/api/sap.ui.core.RenderManager%23methods/voidStart)\nof the Semantic Rendering API (https://ui5.sap.com/1.120/#/api/sap.ui.core.RenderManager) and pass the desired control data as\nthe second parameter to the new API."
         },
         {
            "ruleId": "ui5-linter-no-deprecated-api",
            "severity": 2,
            "line": 167,
            "column": 16,
            "message": "Call to deprecated function 'write' of class 'RenderManager'",
            "messageDetails": "(since 1.92) - Instead, use the Semantic Rendering API (https://ui5.sap.com/1.120/#/api/sap.ui.core.RenderManager).\nThere is no 1:1 replacement for `write`. Typically, `write` is used to create a longer sequence of HTML\nmarkup (e.g. an element with attributes and children) in a single call. Such a markup sequence has to\nbe split into the individual calls of the Semantic Rendering API."
         },
         {
            "ruleId": "ui5-linter-no-deprecated-api",
            "severity": 2,
            "line": 173,
            "column": 16,
            "message": "Call to deprecated function 'write' of class 'RenderManager'",
            "messageDetails": "(since 1.92) - Instead, use the Semantic Rendering API (https://ui5.sap.com/1.120/#/api/sap.ui.core.RenderManager).\nThere is no 1:1 replacement for `write`. Typically, `write` is used to create a longer sequence of HTML\nmarkup (e.g. an element with attributes and children) in a single call. Such a markup sequence has to\nbe split into the individual calls of the Semantic Rendering API."
         }
      ],
      "errorCount": 4,
      "warningCount": 0,
      "fatalErrorCount": 0
   },
   {
      "filePath": "webapp/control/DynamicCompartmentBox.ts",
      "messages": [
         {
            "ruleId": "ui5-linter-no-deprecated-api",
            "severity": 2,
            "line": 81,
            "column": 7,
            "message": "Call to deprecated function 'writeControlData' of class 'RenderManager'",
            "messageDetails": "(since 1.92) - Instead use sap.ui.core.RenderManager#openStart (https://ui5.sap.com/1.120/#/api/sap.ui.core.RenderManager%23methods/openStart) or sap.ui.core.RenderManager#voidStart (https://ui5.sap.com/1.120/#/api/sap.ui.core.RenderManager%23methods/voidStart)\nof the Semantic Rendering API (https://ui5.sap.com/1.120/#/api/sap.ui.core.RenderManager) and pass the desired control data as\nthe second parameter to the new API."
         },
         {
            "ruleId": "ui5-linter-no-deprecated-api",
            "severity": 2,
            "line": 104,
            "column": 9,
            "message": "Call to deprecated function 'write' of class 'RenderManager'",
            "messageDetails": "(since 1.92) - Instead, use the Semantic Rendering API (https://ui5.sap.com/1.120/#/api/sap.ui.core.RenderManager).\nThere is no 1:1 replacement for `write`. Typically, `write` is used to create a longer sequence of HTML\nmarkup (e.g. an element with attributes and children) in a single call. Such a markup sequence has to\nbe split into the individual calls of the Semantic Rendering API."
         },
         {
            "ruleId": "ui5-linter-no-deprecated-api",
            "severity": 2,
            "line": 108,
            "column": 9,
            "message": "Call to deprecated function 'write' of class 'RenderManager'",
            "messageDetails": "(since 1.92) - Instead, use the Semantic Rendering API (https://ui5.sap.com/1.120/#/api/sap.ui.core.RenderManager).\nThere is no 1:1 replacement for `write`. Typically, `write` is used to create a longer sequence of HTML\nmarkup (e.g. an element with attributes and children) in a single call. Such a markup sequence has to\nbe split into the individual calls of the Semantic Rendering API."
         },
         {
            "ruleId": "ui5-linter-no-deprecated-api",
            "severity": 2,
            "line": 129,
            "column": 7,
            "message": "Call to deprecated function 'write' of class 'RenderManager'",
            "messageDetails": "(since 1.92) - Instead, use the Semantic Rendering API (https://ui5.sap.com/1.120/#/api/sap.ui.core.RenderManager).\nThere is no 1:1 replacement for `write`. Typically, `write` is used to create a longer sequence of HTML\nmarkup (e.g. an element with attributes and children) in a single call. Such a markup sequence has to\nbe split into the individual calls of the Semantic Rendering API."
         }
      ],
      "errorCount": 4,
      "warningCount": 0,
      "fatalErrorCount": 0
   }
]

JIRA: CPOUI5FOUNDATION-890

@marianfoo
Copy link
Contributor Author

marianfoo commented Aug 13, 2024

Any reason why text path is the full path and json is relativ?:

Text: /Users/marianzeis/DEV/<apppath>/webapp/control/DynamicCompartmentBox.ts

JSON: webapp/control/DynamicCompartmentBox.ts

@RandomByte
Copy link
Member

Thank you very much for this PR! We'll discuss it in the team and get back to you.

Any reason why text path is the full path and json is relativ?:

Text: /Users/marianzeis/DEV/<apppath>/webapp/control/DynamicCompartmentBox.ts

JSON: webapp/control/DynamicCompartmentBox.ts

The full path in the text output allows you to jump directly to the finding in some IDEs. In VSCode for example, such paths will be rendered as a link that you can "ctrl+click" to open the file and even scroll to the correct position in the file.

Since the JSON output is not intended for direct consumption by developers but rather for automated reportings or statistics, we decided to keep the paths relative to save on file size and to not include potentially sensitive path segments from a developers local system.

ESLint always uses absolute paths in its output: https://eslint.org/docs/latest/use/formatters/#stylish

@flovogt flovogt self-assigned this Aug 15, 2024
@flovogt flovogt added the enhancement New feature or request label Aug 15, 2024
@RandomByte
Copy link
Member

I reviewed the code already last week and have no objections. Regarding the paths I think we should format them relative to the project root.

In addition, we played around with the PR and found the formatting was not ideal in all cases. Especially when there are many findings in a single file, and some are warnings while others are errors (or fatal errors) we should think whether a sorting based on the severity (and then by position) makes sense.

I'm also unsure of the use of emojis for illustrating the severity. I believe the two circles 🟡 🔴 might be hard to distinguish for individuals with visual impairment.

We have an intern this summer (@konnraad) and tasked him with creating a table-version based on your PR, see below. He also added the mentioned sorting based on severity. Please let us know what you think:

Table output sample

UI5 Linter Report

Findings per File

ui5.yaml

Severity Position Message Details
Error 12:7 Use of deprecated library 'sap.ui.commons'

webapp/Component.js

Severity Position Message Details
Warning 4:9 Component does not specify that it uses the descriptor via the manifest.json file A manifest.json has been found in the same directory as the component. Although it will be used at runtime automatically, this should still be expressed in the metadata of the component class (https://ui5.sap.com/#/topic/0187ea5e2eff4166b0453b9dcc8fc64f).
Error 1:75 Import of deprecated module 'sap/m/DateTimeInput' (since 1.32.8) - replaced by sap.m.DatePicker (https://ui5.sap.com/1.120/#/api/sap.m.DatePicker), sap.m.TimePicker (https://ui5.sap.com/1.120/#/api/sap.m.TimePicker) or sap.m.DateTimePicker (https://ui5.sap.com/1.120/#/api/sap.m.DateTimePicker)

webapp/controller/App.controller.js

Severity Position Message Details
Error 7:2 Deprecated access to enum pseudo module 'sap/ui/core/BarColor' Migrating Access to Pseudo Modules (https://ui5.sap.com/#/topic/00737d6c1b864dc3ab72ef56611491c4)
Error 26:22 Access of global variable 'jQuery' (jQuery)
Error 27:32 Call to deprecated function 'control' (avatarDOM.control) since 1.106, use sap.ui.core.Element.closestTo instead.
Error 36:6 Use of deprecated property 'tap' of class 'Button' (since 1.20) - replaced by press event
Error 136:18 Access of global variable 'sap' (sap.ui.getCore)
Error 136:25 Call to deprecated function 'getCore' (sap.ui.getCore) (since 1.118) - Please require 'sap/ui/core/Core' instead and use the module export directly without using 'new'."
Error 136:35 Call to deprecated function 'byId' of class 'Core' (since 1.119) - Please use Element.getElementById (https://ui5.sap.com/1.120/#/api/sap.ui.core.Element)instead.

webapp/manifest.json

Severity Position Message Details
Error 14:17 Use of deprecated library 'sap.ui.commons'

webapp/view/App.view.xml

Severity Position Message Details
Error 7:8 Import of deprecated module 'sap/f/Avatar' (since 1.73) - Use the sap.m.Avatar (https://ui5.sap.com/1.120/#/api/sap.m.Avatar) instead.

webapp/view/Demo.view.xml

Severity Position Message Details
Fatal Error 0:0 Fatal error: Unknown namespace demo for tag App in resource /resources/sap/ui/demo/todo/view/Demo.view.xml

Summary

  • Total problems: 13
    • Warnings: 1
    • Errors: 12 (1 Fatal)

The drawback when using a table is that it's harder to read in plain-text or in the console output compared to your initial proposal. But we are not sure whether this is a valid use case for you anyways.

Should we focus on having a nice format in the rendered markdown or is the plain text format important as well? (CC: @marcelschork)

Looking forward to your feedback. Our intern is also standing by to make the necessary changes depending on what we agree on 😉

@marianfoo
Copy link
Contributor Author

Hi Merlin,
agree with all what you said.
You said you would like to sort by error, in the example is warning on top, I guess error should be on top right?
Other than that, I agree on better rendered output.

I actually don't have (yet) a use case for markdown. I actually tried to implement the ignore-file but that was harder than I thought. Because I already spent time getting into the code, I didn't want to waste that and found that issue from Marcel. This was just easier to implement.
I'm more then happy that @konnraad takes over.
Cheers

@marcelschork
Copy link

@RandomByte I very much like the table format because the readability is much better now (which is essential for PR decoration). I think if somebody choose the format option markdown it doesn't matter how the actual plain text output looks like. I also like the idea to sort by severity and then by position!

konnraad and others added 2 commits August 21, 2024 16:26
Grouping by rules has been removed with
SAP#6 but it was missed to remove the
corresponding data structures.
Copy link

cla-assistant bot commented Aug 21, 2024

CLA assistant check
All committers have signed the CLA.

@RandomByte
Copy link
Member

We moved the summary to the top. Sorting is now by severity (order: Fatal Errors, Errors, Warnings), then line, then column.

The output looks like this now:

Updated Table output sample

UI5 linter Report

Summary

13 problems (12 errors, 1 warnings)
1 fatal errors

Findings

ui5.yaml

Severity Line Message Details
Error 12:7 Use of deprecated library 'sap.ui.commons'

webapp/Component.js

Severity Line Message Details
Error 1:75 Import of deprecated module 'sap/m/DateTimeInput' (since 1.32.8) - replaced by sap.m.DatePicker (https://ui5.sap.com/1.120/#/api/sap.m.DatePicker), sap.m.TimePicker (https://ui5.sap.com/1.120/#/api/sap.m.TimePicker) or sap.m.DateTimePicker (https://ui5.sap.com/1.120/#/api/sap.m.DateTimePicker)
Warning 4:9 Component does not specify that it uses the descriptor via the manifest.json file A manifest.json has been found in the same directory as the component. Although it will be used at runtime automatically, this should still be expressed in the metadata of the component class (https://ui5.sap.com/#/topic/0187ea5e2eff4166b0453b9dcc8fc64f).

webapp/controller/App.controller.js

Severity Line Message Details
Error 7:2 Deprecated access to enum pseudo module 'sap/ui/core/BarColor' Migrating Access to Pseudo Modules (https://ui5.sap.com/#/topic/00737d6c1b864dc3ab72ef56611491c4)
Error 26:22 Access of global variable 'jQuery' (jQuery)
Error 27:32 Call to deprecated function 'control' (avatarDOM.control) since 1.106, use sap.ui.core.Element.closestTo instead.
Error 36:6 Use of deprecated property 'tap' of class 'Button' (since 1.20) - replaced by press event
Error 136:18 Access of global variable 'sap' (sap.ui.getCore)
Error 136:25 Call to deprecated function 'getCore' (sap.ui.getCore) (since 1.118) - Please require 'sap/ui/core/Core' instead and use the module export directly without using 'new'."
Error 136:35 Call to deprecated function 'byId' of class 'Core' (since 1.119) - Please use Element.getElementById (https://ui5.sap.com/1.120/#/api/sap.ui.core.Element)instead.

webapp/manifest.json

Severity Line Message Details
Error 14:17 Use of deprecated library 'sap.ui.commons'

webapp/view/App.view.xml

Severity Line Message Details
Error 7:8 Import of deprecated module 'sap/f/Avatar' (since 1.73) - Use the sap.m.Avatar (https://ui5.sap.com/1.120/#/api/sap.m.Avatar) instead.

webapp/view/Demo.view.xml

Severity Line Message Details
Fatal Error 0:0 Unknown namespace demo for tag App in resource /resources/sap/ui/demo/todo/view/Demo.view.xml

Copy link
Member

@flovogt flovogt left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@flovogt flovogt requested a review from d3xter666 August 21, 2024 17:52
@flovogt flovogt removed their assignment Aug 21, 2024
@flovogt
Copy link
Member

flovogt commented Aug 22, 2024

@marianfoo we appreciate your opinion on the current state of this PR. If you are satisfied with the current state we will follow-up with the merge of the PR and produce a new release.

Copy link
Contributor

@d3xter666 d3xter666 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

Copy link
Contributor Author

@marianfoo marianfoo left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM. Thanks!

@flovogt flovogt merged commit 7329058 into SAP:main Aug 27, 2024
13 checks passed
@openui5bot openui5bot mentioned this pull request Aug 27, 2024
@flovogt
Copy link
Member

flovogt commented Aug 27, 2024

Released with https://github.com/SAP/ui5-linter/releases/tag/v0.3.4. Thanks a lot @marianfoo for your contribution!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

New format option "markdown" for displaying linter reports as comments in pull requests
6 participants