Skip to content

Title and message resources should be enforced to exist to prevent printing empty messages #2538

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

Merged
merged 2 commits into from
Jan 22, 2022

Conversation

tlakollo
Copy link
Contributor

Currently, missing resources will default to an empty string printing an empty message for the diagnostics. Code should not try to gracefully handle errors.

Included in this PR:
DiagnosticString should be able to locate a title and message resource strings otherwise it throws
Add title resource strings for all missing diagnostic Ids

…ce strings otherwise it throws

Add title resource strings for all missing diagnostic Ids
@tlakollo tlakollo merged commit 890591b into dotnet:main Jan 22, 2022
@tlakollo tlakollo deleted the TitleMessageResourcesShouldBeRequired branch January 22, 2022 20:22
jtschuster added a commit to jtschuster/linker that referenced this pull request Jan 24, 2022
Design proposal for DAM-on-type and RUC interactions (dotnet#2168)

Co-authored-by: Sven Boemer <sbomer@gmail.com>

Fix analyzer nullref on assembly attribute (dotnet#2534)

The analyzer runs for property assignment operations, including those in
attributes. To check whether the property assignment should warn, we
look for RUC on the containing symbol. However, assembly-level attributes
are contained in the global namespace, which has a null containing type.

Create a schema for the LinkAttribute XML files (dotnet#2500)

Adds xml schema for ILLink.LinkAttributes.xml, and adds relative paths to the schema in xml used in unit tests to enable linting.

[main] Update dependencies from dotnet/runtime (dotnet#2539)

[main] Update dependencies from dotnet/runtime

Title and message resources should be enforced to exist to prevent printing empty messages (dotnet#2538)

Currently, missing resources will default to an empty string printing an empty message for the diagnostics. Code should not try to gracefully handle errors.

Included in this PR:
- DiagnosticString should be able to locate a title and message resource strings otherwise it throws
- Add title resource strings for all missing diagnostic Ids

Update dependencies from https://github.com/dotnet/runtime build 20220123.5 (dotnet#2542)

[main] Update dependencies from dotnet/runtime

Update dependencies from https://github.com/dotnet/arcade build 20220121.6 (dotnet#2541)

[main] Update dependencies from dotnet/arcade

Analyzer warns when Requires... Attribute is on a static constructor (dotnet#2455)

Adds warnings in the analyzer for IL2116 (RUC not allowed on static ctor) and adds IL2117 (RequiresDynamicCode not allowed on static ctor) and IL2118 (RequiresAssemblyFiles not allowed on static ctor).

Fixes ExpectedWarning not having effects on constructors by adding a Visit override in the compilation tree walker in the test infra.

Adds case in GetDisplayName to differentiate .cctor's and .ctor's.

Linker doesn't seem to be checking ctors for calls to methods with RUC.
This commit removes the check for the expected warnings in the linker
until the bug is fixed.
agocke pushed a commit to dotnet/runtime that referenced this pull request Nov 16, 2022
…inting empty messages (dotnet/linker#2538)

Currently, missing resources will default to an empty string printing an empty message for the diagnostics. Code should not try to gracefully handle errors.

Included in this PR:
- DiagnosticString should be able to locate a title and message resource strings otherwise it throws
- Add title resource strings for all missing diagnostic Ids

Commit migrated from dotnet/linker@890591b
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.

2 participants