question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

More detailed report messages

See original GitHub issue

Given the following code:

namespace ConsoleApp1
{
    class Program {
        static void Main(string[] args)
        {
            Console.WriteLine ("Hello World!");
        }
    }
}

Running dotnet-format --dry-run gives the following output:

Formatting code files in workspace 'C:\dev\xt0rted\actions-playground\Application.sln'.
  src\ConsoleApp1\Program.cs(5,18): Fix whitespace formatting.
  src\ConsoleApp1\Program.cs(8,30): Fix whitespace formatting.
  Formatted code file 'Program.cs'.
  Format complete in 4450ms.

The two violations have the same message of Fix whitespace formatting but there’s no indication as to what the formatting issues are. The first error is csharp_new_line_before_open_brace and the second is csharp_space_between_method_declaration_parameter_list_parentheses.

At the very least the rule names should be included in the output, but more descriptive messages would be best. Knowing that the first issue is because there needs to be a new line before the brace, and the second issue is because there shouldn’t be a space after the method declaration, is a lot more helpful then being told there’s a generic whitespace issue.

Other linters such as ESLint and StyleLint produce a report in the stylish format which has the rule name a violation message. The compact format is most similar to what’s being used now though.

Issue Analytics

  • State:open
  • Created 4 years ago
  • Reactions:1
  • Comments:5 (3 by maintainers)

github_iconTop GitHub Comments

1reaction
sharwellcommented, Feb 10, 2020

I’d love to include a preview of the code fix with the annotations, similar to what you get in Visual Studio,

That part’s relatively easy. You can either run the formatter manually to get the information, or you can indirectly invoke the code fix and then provide some sort of UI to present the changes. CodeFixTest<TVerifier> is a good example of executing code fixes (likely more complicated than you need but shows pretty much everything).

0reactions
dhazelcommented, Apr 3, 2023

+1 This would be a great DX improvement

Read more comments on GitHub >

github_iconTop Results From Across the Web

Block, filter, and report messages on iPhone
In the Messages app , you can block unwanted messages, filter messages from unknown senders, and report spam or junk messages.
Read more >
Report spam - Android - Messages by Google
You can also open a conversation and report it as spam. From the conversation, tap More options More and then Details and then...
Read more >
How to Recognize and Report Spam Text Messages
It could be a scammer trying to steal your personal and financial information. Here's how to handle and report unwanted text messages. Spam...
Read more >
Report messages in Google Chat - Android
Report a specific message. On your device, open the Chat app or Gmail app "" . At the bottom, tap Chat "" or...
Read more >
Enable the Report Message or the Report Phishing add-ins
The Report Message icon in the Simplified Ribbon: Select More commands ... Just me; Entire organization; Specific users/groups: Find and ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found