generated from SAP/repository-template
-
Notifications
You must be signed in to change notification settings - Fork 4
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: Component best practices- async flags check #73
Merged
Merged
Changes from 77 commits
Commits
Show all changes
90 commits
Select commit
Hold shift + click to select a range
e2bab81
feat: Analyze async flags
d3xter666 46b4622
feat: Implement manifest checks
d3xter666 6e32f58
feat: Extend linting further
d3xter666 cda4880
fix: JSON "parse" improvement
d3xter666 c980c07
feat: Handle variations for error messaging
d3xter666 7d5711d
feat: Checks for inline manifest
d3xter666 4e8d607
fix: Tests
d3xter666 3280f54
fix: Merge conflicts
d3xter666 a3899a0
fix: Reset Component.js
d3xter666 2a8c08e
fix: Tests
d3xter666 a02fbad
refactor: Restructure rules tests to use a common execution
d3xter666 baaeb79
refactor: Linter helper
d3xter666 9358dd4
feat: Add tests for Best practices
d3xter666 7524834
fix: Tests
d3xter666 daeb315
refactor: Automatically resolve BestPractices subdirs
d3xter666 badf560
feat: Add more tests for Best Practices
d3xter666 1f998ba
fix: Detection of unset values
d3xter666 acd3472
refactor: Improve messaging
d3xter666 89b1261
fix: Eslint
d3xter666 1611ad9
fix: Update snapshots
d3xter666 5dc3f12
refactor: Interfaces are part of metadata
d3xter666 894029c
refactor: Look into hierarchy
d3xter666 b88f623
fix: Extract and check against real module dependency var
d3xter666 aedea65
refactor: Allow sourcefile tests for a whole dir
d3xter666 079444b
test: Add BestPractices samples
d3xter666 8bb2b38
fix: Allow filtering for BestPractices tests
d3xter666 c78eaca
fix: Analyze only Component.js files
d3xter666 b95900c
test: Add negative test case
d3xter666 ddf092d
fix: Test Component's namespace
d3xter666 e94be3f
fix: Tests
d3xter666 455267a
fix: Eslint
d3xter666 6199213
test: Add positive case
d3xter666 aa6de7c
fix: Update snapshots
d3xter666 d64b365
fix: Windows paths for tests
d3xter666 c2f2ece
fix: Paths on windows
d3xter666 292334a
refactor: Cleanup obsolete code
d3xter666 5a9aa70
refactor: Cleanup code
d3xter666 1b1a277
refactor: Always try to process the manifest
d3xter666 c410868
refactor: Detect sap/ui/core/UIComponent dependency
d3xter666 95d29c4
refactor: Lint Message
d3xter666 52dd0d5
fix: Update messages & tests
d3xter666 5338f9c
feat: Detect manifest.json section in Component.js
d3xter666 05442d5
fix: Detect missing manifest declaration in Component.js
d3xter666 1091024
fix: Linting test filenames
d3xter666 546cb41
fix: Eslint
d3xter666 29f8cb7
fix: Paths for windows
d3xter666 1c6ee18
feat: Handle ES6 interface implementation
d3xter666 4d9e33a
test: Checks for inheritance in ES6 components
d3xter666 e2238e9
refactor: Renames & docs
d3xter666 013122f
fix: Eslint issues
d3xter666 af1d2f9
fix: Handle quoted properties
d3xter666 29fa1db
test: Add case for missing view & routing
d3xter666 a7a307e
refactor: Migrate checks to enum
d3xter666 79cdbe7
fix: Reset result template
d3xter666 89f11f8
refactor: Remove redundant comments
d3xter666 bd2f0da
refactor: Rename BestPractices
d3xter666 9679220
refactor: Exit early
d3xter666 0cd5a7f
refactor: Remove redundant checks
d3xter666 a8e62d2
refactor: Resolve SourceFile
d3xter666 da987fd
refactor: Cleanup redundant code
d3xter666 cacf900
refactor: Improve messaging
d3xter666 4d8a01c
fix: Eslint
d3xter666 c30a8c9
fix: Rename bestPractices.ts
d3xter666 adae2ac
refactor: Extract virBasePath from filePaths
d3xter666 b3c1bb5
feat: Provide links to manifest.json when needed
d3xter666 168fd14
fix: Link resolver for LinterContext
d3xter666 697869c
test: Update snapshots with the new changes
d3xter666 f840097
fix: Eslint
d3xter666 c9319d9
fix: LintContext fix links resolve
d3xter666 49d4e33
refactor: Improve messaging
d3xter666 34f6698
refactor: Improve runtime performance by checking Component.js
d3xter666 1bb546d
refactor: Cleanup
d3xter666 e670ecc
test: Add case for obsolete async flag
d3xter666 ca2115e
test: Update snapshots
d3xter666 417a94b
fix: Correct logic for reporting
d3xter666 604ef22
test: Add test cases for single async flags
d3xter666 6d63c56
fix: Report missing manifest definition only when there is a manifest…
d3xter666 77e5369
deps: Rebuild api-json deps from UI5 1.120.13
d3xter666 0b01e1b
refactor(tests): Rename BestPractices to AsyncComponentFlags, use dir…
RandomByte 84dfaf2
refactor: Rename bestPractices module to asyncComponentFlags, also ch…
RandomByte d2eabaa
test(AsyncComponentFlags): Add more test cases
RandomByte e7a8955
refactor(asyncComponentFlags): Remove usage of internal API, improve …
RandomByte 608dd67
refactor(asyncComponentFlags): Rename types, use boolean for async in…
RandomByte a718397
refactor(asyncComponentFlags): Simplify async flag merge logic
RandomByte 992dee4
test(AsyncComponentFlags): Move parent components into subdirs
RandomByte f4be3cb
fix: Skip depcheck for fake modules in testing
d3xter666 85fda50
refactor: Improve file path handling
RandomByte 7790b4a
refactor: Update message texts
RandomByte f136e64
refactor: Fix message text
RandomByte 8e42467
refactor: Revert "refactor: Extract virBasePath from filePaths"
RandomByte File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What was the reason for adae2ac ?
I'm wondering whether this approach still works if the first path in the array is deeply nested. For example
/resources/my/app/controller/MyController.js
would lead to virtual base path/resources/my/app/controller/
. Which does not match for other paths like/resources/my/app/view/MyView.view.xml
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The reason for that change and the related ones is that for the test cases it used to read files one by one and didn't have the context for the parent components, for example.
The problem lies in the fact that without a
/resource
prefix, the files were not found. To be honest, I'm not sure for the core reason behnid this behaviour, but I guess it might be something with the ReaderThere was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hmmm, you're right about the deeply nested components 🤔
But, how to extract the namespace without breaking the signature of the function?
Maybe, reuse the logic from
lintProject()
, but then we need a project, not a single file...There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I reverted the commit and all tests are still green 😅
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Unfortunately, it’s not just that change 😅
I have tried several things to provide a better handling of those resources.
Maybe, directly comparing/reseting the file with the main branch would be easier 😅
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hm, not sure I understand the implications...
I just pushed the revert which restores the behavior I think is better (and should work for deep paths). Let's discuss it based on that 👍
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please take a look here: src/linter/linter.ts
This is the original change compared to the main branch.
The change is working pretty well, except that it cannot handle
/test-resources/
and that's why I needed to find a better way of doing it.Please take a look at the conversation we had with @flovogt on that matter here: https://github.com/SAP/ui5-linter/pull/73/files#r1601613818
But, if we take a look at the implementation of the
lintProject()
method, it again relies only on the/resources
path, ignoring the/test-resources
.If this is ok, then we can leave it as it is now :)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Got it, thanks. Since the
lintFile
API is currently only used in our tests, I think we can safely go with the current state and ignore the test-resources case for now 👍