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.

Ability to check formatting / code style without writing to disk

See original GitHub issue

Hello!

Many existing code formatting tools ( Prettier, ClangFormat ) support checking code format without modifying source files.

Currently to only check formatting I can implement some wrapper which will clone source code, run `dotnet-format’ on this clone and then compare formatted files with original source code. But this seems to be too complex approach for such scenario.

Do you plan to implement feature allowing to check format in dotnet-format (might be a console application option)?..

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Reactions:3
  • Comments:15 (13 by maintainers)

github_iconTop GitHub Comments

2reactions
roman-petrovcommented, Mar 4, 2019

@jmarolf , thanks for quick response. Sorry, but I didn’t knew that --dry-run option exists, maybe it would help in case above…

Just wondering: will dotnet-format --dry-run -v diag process exit with non-zero exit code if it found files that have to be formatted?

The scenario: I would like to use dotnet-format in continuous integration process or pre-commit git hook so CI build/commit should fail if dotnet-format founds any files that should be reformatted.

1reaction
roman-petrovcommented, Mar 6, 2019

@jmarolf thank you, I will open a PR early next week.

Read more comments on GitHub >

github_iconTop Results From Across the Web

How to Fix Format Disk Errors Without Formatting Your ...
You can encounter a format disk error on your PC for various reasons. ... Try this and check to see if it works...
Read more >
Auto code formatting in Android Studio - intellij idea
Using Flutter to auto format code when saving: tick - File|Settings|Language & Frameworks|Flutter - 'Format code on save'.
Read more >
【Fixed】7 Ways to Fix the 'You Need to Format the Disk ...
It includes entering code, so this is how to fix format disk error without formatting: Step 1: From the keyboard, press the "Windows"...
Read more >
Reformat code | IntelliJ IDEA Documentation
IntelliJ IDEA lets you reformat your code according to the requirements you've specified in your current code style scheme or the .editorconfig ...
Read more >
format | Microsoft Learn
Reference article for the format command that formats a drive to accept Windows files.
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