-
Notifications
You must be signed in to change notification settings - Fork 663
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
Ignore line endings & whitespace in baseline code snippets #6000
Merged
Conversation
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
bdsl
force-pushed
the
ignore-line-endings-in-baseline
branch
from
June 26, 2021 21:00
f9b1aa5
to
3097bcc
Compare
bdsl
changed the title
Simplify lots of usage checks
Ignore line endings & whitespace in baseline code snippets
Jun 26, 2021
bdsl
force-pushed
the
ignore-line-endings-in-baseline
branch
from
June 26, 2021 21:30
5d505b3
to
ee00c23
Compare
…t baseline Should fix issue vimeo#5979 We could also trim code issues when writing to baseline, but I think that's a minor BC break, so probably shouldn't happen until Psalm 9.
bdsl
force-pushed
the
ignore-line-endings-in-baseline
branch
from
June 26, 2021 21:37
ee00c23
to
0722401
Compare
I have tested this manually by applying this patch - the current version of Psalm reports an Error when run on itself with the patch applied. The version from this PR reports 'no errors found'. I don't think this needs an automated end-to-end test.
From b0dcbef6bbdfca1b0017002678cefbb3750f94f9 Mon Sep 17 00:00:00 2001
From: Barney Laurance <[email protected]>
Date: Sat, 26 Jun 2021 22:33:25 +0100
Subject: [PATCH] add-carrige-return-to-issue-in-baseline
---
psalm-baseline.xml | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/psalm-baseline.xml b/psalm-baseline.xml
index 67e00699f..687294a95 100644
--- a/psalm-baseline.xml
+++ b/psalm-baseline.xml
@@ -2,7 +2,7 @@
<files psalm-version="dev-master@5e8219b613d9f97cd7eeba16e1fea75cc8a808e6">
<file src="examples/TemplateChecker.php">
<PossiblyUndefinedIntArrayOffset occurrences="2">
- <code>$comment_block->tags['variablesfrom'][0]</code>
+ <code>$comment_block->tags['variablesfrom'][0] </code>
<code>$matches[1]</code>
</PossiblyUndefinedIntArrayOffset>
</file>
--
2.30.2
|
6k !!!! |
bdsl
commented
Jun 26, 2021
weirdan
reviewed
Jun 27, 2021
weirdan
reviewed
Jun 27, 2021
Co-authored-by: Bruce Weirdan <[email protected]>
bdsl
force-pushed
the
ignore-line-endings-in-baseline
branch
from
June 27, 2021 09:36
5bdb6ce
to
140cf01
Compare
weirdan
approved these changes
Jun 27, 2021
Thanks! |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
This change makes Psalm trim code snippets read from the baseline, and the snippets from issues found in the current analysis, so that the comparison won't care whether either of them has any carriage return character, or any other type of white space at the start or end.
Should fix #5979