csharpstandard icon indicating copy to clipboard operation
csharpstandard copied to clipboard

Nullability: conversion behavior

Open jnm2 opened this issue 1 year ago • 1 comments

Maybe we jinxed it after all?

This is my first PR to the repo. Guidance is very helpful. Think of the lines of this PR as a series of questions: how far to go, whether it's worth going here, how do we do things?

jnm2 avatar Jan 01 '25 01:01 jnm2

@BillWagner Would you like to take a look at these added nullability examples since you had been working on previous ones?

jnm2 avatar Mar 19 '25 21:03 jnm2

Ii think you need to be looking for ^>.*\r\n> *\r\n in a block quote but not in a contained code block in the block quote (i.e. just be wary of false +ve’s). This sequence occurs at the start & end of this particular code block. As Bill mentions you can disable particular errors in a file, just add HTML comments:

Disable one or more rules by name: Enable one or more rules by name: <!-- markdownlint-enable MD001 MD005 —>

On 17/04/2025, at 10:56 am, Joseph Musser @.***> wrote:

@jnm2 commented on this pull request.

In standard/types.md https://github.com/dotnet/csharpstandard/pull/1242#discussion_r2047899850:

+> { +> public void M1(string p) +> { +> _ = (string?)p; // No warning, widening +> } +> +> public void M2(string? p) +> { +> _ = (string)p; // Warning, narrowing +> _ = (string)p!; // No warning, suppressed +> } +> } +> ``` +> +> end example

I might be misunderstanding. This seems to be rule https://github.com/DavidAnson/markdownlint/blob/v0.37.4/doc/md028.md. Scrolling through files and a regex search in all files for ^>.*\r\n\r\n> didn't turn anything up, so I haven't found any examples to follow.

Looking at what this rule is, it seems to be saving people from creating block quotes that get unified by some parsers and not others. If that's not a concern in this spot, then it seems that it must not be a concern for the entire repo, and maybe we could ignore MD028 globally with the run of this tool. What do you think?

— Reply to this email directly, view it on GitHub https://github.com/dotnet/csharpstandard/pull/1242#discussion_r2047899850, or unsubscribe https://github.com/notifications/unsubscribe-auth/ABSYVW25CK5JCOPYYOQGUJ32Z3NZNAVCNFSM6AAAAABUOEA7CKVHI2DSMVQWIX3LMV43YUDVNRWFEZLROVSXG5CSMV3GSZLXHMZDONZUGA3DQOBTGA. You are receiving this because you were mentioned.

Nigel-Ecma avatar Apr 16 '25 23:04 Nigel-Ecma

CI is nice and fast. Really neat system here!

jnm2 avatar Apr 17 '25 00:04 jnm2

@BillWagner With one review, am I okay to merge this?

jnm2 avatar May 28 '25 18:05 jnm2

@BillWagner With one review, am I okay to merge this?

I had one final suggestion, and then yes, let's :shipit:

BillWagner avatar May 28 '25 19:05 BillWagner