Ability to check formatting / code style without writing to disk
See original GitHub issueHello!
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:
- Created 5 years ago
- Reactions:3
- Comments:15 (13 by maintainers)
Top 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 >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
@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 ifdotnet-format
founds any files that should be reformatted.@jmarolf thank you, I will open a PR early next week.