Skip to content

Add BuildCheck rule about used env variable#10307

Merged
YuliiaKovalova merged 35 commits intodotnet:mainfrom
YuliiaKovalova:dev/ykovalova/used_envVariable
Jul 16, 2024
Merged

Add BuildCheck rule about used env variable#10307
YuliiaKovalova merged 35 commits intodotnet:mainfrom
YuliiaKovalova:dev/ykovalova/used_envVariable

Conversation

@YuliiaKovalova
Copy link
Copy Markdown
Member

@YuliiaKovalova YuliiaKovalova commented Jun 28, 2024

Fixes #9885

Context

The used environment variable will be reported after enabling this rule with pointing to exact file/location where it happened.

Changes Made

The logic for tracking location was added by extending interface IProperty with property location(file,column,line) . It can be reused for other rules too.

The created rule relies on the EnvironmentVariableRead event raise.

  • some changes in E2e tests - test project files and editor config content were moved to TestAssets, so after changing the content of any of them, rebuild isn't required.

Testing

Extended existing e2e tests + REENABLED THEM

@YuliiaKovalova YuliiaKovalova changed the title Dev/ykovalova/used env variable Add analyzed rule about used env variable Jul 9, 2024
@YuliiaKovalova YuliiaKovalova changed the title Add analyzed rule about used env variable Add BuildCheck rule about used env variable Jul 9, 2024
@YuliiaKovalova YuliiaKovalova marked this pull request as ready for review July 11, 2024 14:19
@YuliiaKovalova
Copy link
Copy Markdown
Member Author

experimental branch for perf check: https://github.com/dotnet/msbuild/tree/exp/ykovalova/extended_IProperty_check

Copy link
Copy Markdown
Contributor

@f-alizada f-alizada left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Leaving some comments to learn more about the introduced changes and educate myself with answers :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Built-in analyzer] Build depends on an environment variable

3 participants