dotnet / dotnet/msbuild

Warning for leaked "private" variables

Open
#4,272 3 comments 1 reaction 0 assignees View on GitHub
Feature: Warning Waves triaged
Dominant language
C#
Stars
5.5k
Forks
1.5k
Avg merge
1d 8h
Merged PRs (30d)
141

Description

MSBuild doesn't currently have any scoping concept for properties or items (adding one is #4074). As a stopgap, we could apply a heuristic, opt-in warning that some patterns are likely to be bad, with a suggested fix.

One possibility would be:

* If an item name is prefixed with an underscore, and
* It is not referenced in any target other than the one that defines it,

warn that it should be emptied before returning.

The goal here would be to reduce SDK authoring errors like dotnet/sdk#3027 where an item name gets inadvertently reused.

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.