Skip to content

Commit

Permalink
feat: Wildcard is not properly defined false positive warning when ty…
Browse files Browse the repository at this point in the history
…ping first input, then output section, close #557
  • Loading branch information
iromeo committed Nov 5, 2024
1 parent 486907c commit 6c00e24
Show file tree
Hide file tree
Showing 4 changed files with 37 additions and 11 deletions.
11 changes: 2 additions & 9 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,17 +4,10 @@
# SnakeCharm Plugin Changelog

## [2024.2.3]
Released on <not released>


### Features
- TODO
Released on 5 November 2024

### Fixed
- TODO

### Changed
- TODO
- Wildcard is not properly defined false positive warning when typing first input, then output section (see [#557](https://github.com/JetBrains-Research/snakecharm/issues/557)


## [2024.2.2]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,9 @@ open class SmkRuleOrCheckpointArgsSectionImpl(node: ASTNode) : SmkArgsSectionImp
)
}

override val isWildcardsDefiningSection = sectionKeyword in WILDCARDS_DEFINING_SECTIONS_KEYWORDS
override val isWildcardsDefiningSection by lazy {
sectionKeyword in WILDCARDS_DEFINING_SECTIONS_KEYWORDS
}

override fun multilineSectionDefinition(): Boolean = multilineSectionDefinition(this)

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,5 +33,7 @@ class SmkUseArgsSectionImpl(node: ASTNode) : SmkArgsSectionImpl(node), SmkRuleOr
)
}

override val isWildcardsDefiningSection = sectionKeyword in WILDCARDS_DEFINING_SECTIONS_KEYWORDS
override val isWildcardsDefiningSection by lazy {
sectionKeyword in WILDCARDS_DEFINING_SECTIONS_KEYWORDS
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -174,6 +174,35 @@ Feature: Inspection: SmkWildcardNotDefinedInspection
| checkpoint |
| checkpoint |

Scenario: Correctly hide error on typing output section
Given a snakemake project
Given I open a file "foo.smk" with text
"""
rule foo:
input: "foo/{sample}"
# formatter hack
"""
And I put the caret after "foo/{sample}"
And SmkWildcardNotDefinedInspection inspection is enabled
Then I expect inspection error on <sample> with message
"""
Wildcard 'sample' isn't properly defined.
"""
When I check highlighting errors
When I type multiline text '\noutput: ' at the caret position
When I type multiline text '"boo/{sampl}"' at the caret position
And I put the caret after "boo/{sampl
When I type multiline text 'e' at the caret position
Then I expect text in current file:
"""
rule foo:
input: "foo/{sample}"
output: "boo/{sample}"
# formatter hack
"""
Then I expect no inspection errors
When I check highlighting errors
Scenario Outline: Undefined wildcard if it is was defined in sections, which is overridden
Given a snakemake project
Given I open a file "foo.smk" with text
Expand Down

0 comments on commit 6c00e24

Please sign in to comment.