当前位置:网站首页>In Net 6 using dotnet format formatting code
In Net 6 using dotnet format formatting code
2022-06-25 04:46:00 【Dotnet cross platform】
I have to admit , stay code review When , I spent a lot of time studying C# Code format problem for , This is not a very meaningful job , I should focus on other things , Instead of watching colleagues forget to format the code , Or a code editor that uses different rules .
Now? , We can use dotnet format Check for code format problems . This is a .NET 6 New functions ,.NET CLI Introduced dotnet format command , And it is a built-in command .
It should be noted that , If you install it .NET 6 Preview 7 SDK Or later , You should use dotnet-format instead of dotnet format, Otherwise, running the command will report an error .
How to use ?
Format all the code in the solution :
dotnet format ./solution.slnCode to format a single item
dotnet format ./src/application.csprojVerify that all code is in the correct format :
dotnet format --verify-no-changesformat src and tests All code in the directory , And exclude src/submodule-a Directory code :
dotnet format --include ./src/ ./tests/ --exclude ./src/submodule-a/Format and output details
dotnet-format -v diagFormat and record the report to a file
dotnet format --report ./report.jsonmore dotnet-format Information about , You can see the link below
https://github.com/dotnet/format
END
Made a .NET The learning website , It covers Distributed systems , Data structure and algorithm , Design patterns , operating system , Computer network, etc , reply dotnet Get the website address , reply Interview questions obtain .NET Interview questions .

边栏推荐
- Classification of gbase 8s locks
- js的arguments
- Sleep more, you can lose weight. According to the latest research from the University of Chicago, sleeping more than 1 hour a day is equivalent to eating less than one fried chicken leg
- dotnet-exec 0.4.0 released
- 魔法猪系统重装大师怎么使用
- MySQL concept and operation (III)
- JS call() and apply()
- leetcode1221. Split balance string
- 基于Cortex-M3、M4的精准延时(系统定时器SysTick延时,可用于STM32、ADuCM4050等)
- Wechat likes to pay attention to the solution of invalid automatic reply
猜你喜欢
三角形类(构造与析构)

CTF_ Web: Advanced questions of attack and defense world expert zone WP (19-21)

重磅直播 | 相移法+多频外差之数学原理推导+实现

Vscade setting clang format

Chapter IX app project test (2) test tools

CTF_ Web: deserialization of learning notes (II) CTF classic test questions from shallow to deep

第九章 APP项目测试(2) 测试工具

Kotlin Compose 监听软键盘 点击enter提交事件

Join() in JSZ

CTF_ Web: how to recognize and evaluate a regular expression
随机推荐
Machine learning deep learning -- Vectorization
Codeforces Round #802 (Div. 2) C D
Which programming language is the most cumbersome to implement Hello world?
JS call() and apply()
Gbase 8s stored procedure flow control
My IC journey - the growth of senior chip design verification engineers - "Hu" said that IC engineers are perfect and advanced
执行SQL响应比较慢,你有哪些排查思路?
Trigger for gbase 8s
cannot import name ‘escape’ from ‘jinja2’【成功解决】
重磅直播 | 相移法+多频外差之数学原理推导+实现
Triangle class (construction and deconstruction)
[image fusion] image fusion based on MATLAB directional discrete cosine transform and principal component analysis [including Matlab source code 1907]
在 .NET 6 中使用 dotnet format 格式化代码
ASEMI大功率场效应管和三极管的区别
php开发支付宝支付功能之扫码支付流程图
SOC验证环境的启动方式
Classification of gbase 8s locks
成功解决:selenium.common.exceptions.TimeoutException: Message: timeout: Timed out receiving message from
冰冰学习笔记:循环队列的实现
ROS2/DDS/QoS/主题的记录