This repository has been archived by the owner on Dec 5, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Fix paket.lock file parser Description =========== The `paket.lock` file parser has issues with counting leading whitespaces. The value from the old logic `def newLeadingWhitespaces = (line =~ /\s/).size()` returns the number of all white space characters in the current line. The second part: ```groovy if (newLeadingWhitespaces > currentLeadingWhitespaces) { currentIndent++ } else if (newLeadingWhitespaces < currentLeadingWhitespaces) { currentIndent-- } ``` didn't take into account when the indention level suddenly jumped from 3 to 1. I also made the method `List<String> getAllDependencies(List<String> references)` recursive. I added a new test covering the failing behavior Changes ======= ![FIX] `paket.lock` file parsing ![IMPROVE] `getAllDependencies` method by making it recursive ![ADD] new test example * Refactor the lock parser some more and add more test cases I switched from `if` statements to `switch/case` because of esthetical reasons. I added some more guards around the switch arms to limit crashes. We might need to add a proper parser with error results if and when we want to support multi type lock files.
- Loading branch information
Showing
2 changed files
with
155 additions
and
67 deletions.
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