Comments (15)
应该比较新的版本都可以,我一般不会专门找某个特定版本。
配置文件指定到flare下面的.clang-format应该就可以,现在是有什么地方格式化的不合预期吗
from flare.
应该比较新的版本都可以,我一般不会专门找某个特定版本。
配置文件指定到flare下面的.clang-format应该就可以,现在是有什么地方格式化的不合预期吗
clang-format 14和clang-format 15格式化出来的有一点点区别, 我想加一个clang-format check的CI
flare/flare/fiber/this_fiber_test.cc
Lines 15 to 28 in d653408
这个头文件的顺序应该不对吧, flare下面的.clang-format头文件好像格式化不了这种形式https://google.github.io/styleguide/cppguide.html#Names_and_Order_of_Includes
这个得我们自己加blank line
from flare.
from flare.
这个确实是代码需要修改,应该按照空行分组。分组了之后clang-format应该就没问题了
from flare.
挺多需要format的, 我用clang-format 15格式化了一下整个项目, proto文件感觉没有必要格式化
from flare.
这个确实是代码需要修改,应该按照空行分组。分组了之后clang-format应该就没问题了
有没有不需要手动分组的方法:) clang-format承当这个工作
from flare.
这个确实是代码需要修改,应该按照空行分组。分组了之后clang-format应该就没问题了
有没有不需要手动分组的方法:) clang-format承当这个工作
我尝试过这个, 但对于_benchmark.cc
的文件没办法, 而且flare里还有一些.cc
和_test.cc
文件里相关的文件不是他本身的前缀, 也不生效
IncludeBlocks: Regroup
IncludeCategories:
- Regex: '^<.*\.h>'
Priority: 1
- Regex: '^<.*'
Priority: 2
- Regex: '^"(google|gperftools|jemalloc|lz4|snappy|nghttp2|zlib|benchmark|jsoncpp|ctemplate|curl|gflags|fmt|gtest|gmock|glog|yaml-cpp|openssl|opentracing|opentracing-cpp|zstd|rapidxml|xxhash|blake3)/'
Priority: 3
- Regex: '.*'
Priority: 4
from flare.
这个确实是代码需要修改,应该按照空行分组。分组了之后clang-format应该就没问题了
有没有不需要手动分组的方法:) clang-format承当这个工作
不分组的话我理解格式化完了应该跟现在这个写法一样,这个也ok啊。也就是有空行的文件就分组格式化,没空行的先一起排序,也不影响什么,后面修改到了对应的文件在相应的处理这样
from flare.
这个确实是代码需要修改,应该按照空行分组。分组了之后clang-format应该就没问题了
有没有不需要手动分组的方法:) clang-format承当这个工作
不分组的话我理解格式化完了应该跟现在这个写法一样,这个也ok啊。也就是有空行的文件就分组格式化,没空行的先一起排序,也不影响什么,后面修改到了对应的文件在相应的处理这样
flare/flare/rpc/internal/stream_test.cc
Lines 15 to 26 in d653408
clang-format应该检测不到这种情况, 我的意思是git-clang能不能自动格式化成下面这种情况, 而不需要我们自己去分组
#include <utility>
#include <vector>
#include "gmock/gmock.h"
#include "gtest/gtest.h"
#include "flare/base/chrono.h"
#include "flare/fiber/latch.h"
#include "flare/fiber/timer.h"
#include "flare/testing/main.h"
from flare.
这个好像我也没听说有什么办法,一直都是手动处理的
from flare.
这个好像我也没听说有什么办法,一直都是手动处理的
OK
from flare.
这个好像我也没听说有什么办法,一直都是手动处理的
IncludeIsMainRegex: "(_test|_benchmark)?$"
IncludeBlocks: Regroup
IncludeCategories:
- Regex: '^<.*\.h>'
Priority: 1
- Regex: '^<.*'
Priority: 2
- Regex: '^"(google|gperftools|jemalloc|lz4|snappy|nghttp2|zlib|benchmark|jsoncpp|ctemplate|curl|gflags|fmt|gtest|gmock|glog|yaml-cpp|openssl|opentracing|opentracing-cpp|zstd|rapidxml|xxhash|blake3)/'
Priority: 3
- Regex: '.*'
Priority: 4
这个能处理flare中绝大多少的了, 极少部分比如上条PR里你提到了flare/base/object_pool/thread_local_test.cc
这种才处理不了, 只能这样处理了, 你看可以吗
// clang-format off
#include "flare/base/object_pool.h"
// clang-format on
from flare.
Group 3这个写法维护有点麻烦,还是保留PreserveBlocks吧,我感觉本地一次性用Regroup生成对现有代码的修复就可以了
然后clang-format off那些应该可以删掉。
另外我看那个mr有个小问题,好像把example/下面的代码的第一个include搞到其他目录下面的同名.h去了。这个不太对,example下面(除了恰好有.h,应该很少)直接从系统头文件开始比较好。逻辑上来说example下面的看做“外界”代码
from flare.
Group 3这个写法维护有点麻烦,还是保留PreserveBlocks吧,我感觉本地一次性用Regroup生成对现有代码的修复就可以了
然后clang-format off那些应该可以删掉。
另外我看那个mr有个小问题,好像把example/下面的代码的第一个include搞到其他目录下面的同名.h去了。这个不太对,example下面(除了恰好有.h,应该很少)直接从系统头文件开始比较好。逻辑上来说example下面的看做“外界”代码
OK
from flare.
Group 3这个写法维护有点麻烦,还是保留PreserveBlocks吧,我感觉本地一次性用Regroup生成对现有代码的修复就可以了
然后clang-format off那些应该可以删掉。
另外我看那个mr有个小问题,好像把example/下面的代码的第一个include搞到其他目录下面的同名.h去了。这个不太对,example下面(除了恰好有.h,应该很少)直接从系统头文件开始比较好。逻辑上来说example下面的看做“外界”代码
我另起一个pr
from flare.
Related Issues (20)
- Http header data structure HOT 13
- Rpc: Http parse HOT 5
- 针对K8s容器环境是否有需要注意的优化配置呢 HOT 2
- update blade HOT 9
- logging HOT 11
- if have any plan to support bazel HOT 1
- bazel build ... 失败 HOT 6
- 请问有合适的源码阅读顺序吗 HOT 5
- 对GetFreeCount的取值比较困惑 HOT 5
- Does the server example in the flare example support 1 thread start? HOT 4
- clang-17 asan/tsan fiber coredump
- 关于Function类的疑问 HOT 2
- 问一个非常诡异的用例 HOT 10
- 关于调度参数的疑问 HOT 1
- 编译时间太长 HOT 4
- 调试相关 HOT 3
- Fiber scheduling takes too long HOT 3
- Can it support machines with large cores HOT 4
- 使用`getaddrinfo`会不会更好一点 HOT 6
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from flare.