Linter rules get confused by merge markers
- Dominant language
- Bicep
- Stars
- 3.6k
- Forks
- 830
- Avg merge
- 1d 21m
- Merged PRs (30d)
- 79
Description
**Bicep version**
VS Code 0.4.1
**Describe the bug**
When dealing with a merge conflict, the linter rules can get a bit confused.
**To Reproduce**
In the below example, `resourceName` is clearly used
```bicep
var resourceName = 'test'
<<<<<<< HEAD
resource databaseAccount 'Microsoft.DocumentDB/databaseAccounts@2021-05-15' = {
=======
resource databaseAccount 'Microsoft.DocumentDB/databaseAccounts@2021-03-01-preview' = {
>>>>>>> origin/main
name: resourceName
//...
}
```
**Additional context**
It would be great if the linter is clever enough to be able to navigate the merge markers - in this case it should know not to warn as in all paths, the `resourceName` variable is used. That said, I imagine doing that could get complicated quickly so maybe it's sufficient to disable the linter until the merge markers are removed / resolved.
Contributor guide
Research direction
Start with the merge-conflict reproduction in the issue and trace how the Bicep linter processes source containing conflict markers. Compare the diagnostic for the unused resourceName variable before and after resolving the markers; done means the linter either handles all merge-marker paths correctly or is disabled while markers remain.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- vscode
- Domain
- devtools
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 42/100