Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

添加clang-format文件 #2680

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open

添加clang-format文件 #2680

wants to merge 2 commits into from

Conversation

yybbwc
Copy link
Contributor

@yybbwc yybbwc commented Feb 16, 2025

https://clang.llvm.net.cn/docs/ClangFormatStyleOptions.html 这是文档

使用示例:

clang-format -i ../gframe/*.cc

风格可以改……

@purerosefallen
Copy link
Collaborator

What is this file for?

@yybbwc
Copy link
Contributor Author

yybbwc commented Feb 16, 2025

What is this file for?

这个是clang-format文件,用于进行代码格式化,统一风格。
由于它背靠clang(三大c++编译器之一),所以目前很流行。

风格可以改……

@purerosefallen
Copy link
Collaborator

What is this file for?

这个是clang-format文件,用于进行代码格式化,统一风格。 由于它背靠clang(三大c++编译器之一),所以目前很流行。

风格可以改……

Something like eslint on C++?

Plz make sure the code it lints compats with most code in this repo after running a lint, without making a huge change.

@yybbwc
Copy link
Contributor Author

yybbwc commented Feb 16, 2025

What is this file for?

这个是clang-format文件,用于进行代码格式化,统一风格。 由于它背靠clang(三大c++编译器之一),所以目前很流行。

风格可以改……

Something like eslint on C++?

Plz make sure the code it lints compats with most code in this repo after running a lint, without making a huge change.

不,它不是。
诊断代码错误,得用clang-tidy。
这是clang-format,用来格式化代码(例如更改缩进,加上或者减去空行,限制单行行数)。

这个文件的代码风格与ygopro原风格不符,需要进一步磋商成统一风格。

@purerosefallen
Copy link
Collaborator

What is this file for?

这个是clang-format文件,用于进行代码格式化,统一风格。 由于它背靠clang(三大c++编译器之一),所以目前很流行。
风格可以改……

Something like eslint on C++?
Plz make sure the code it lints compats with most code in this repo after running a lint, without making a huge change.

不,它不是。 诊断代码错误,得用clang-tidy。 这是clang-format,用来格式化代码(例如更改缩进,加上或者减去空行,限制单行行数)。

这个文件的代码风格与ygopro原风格不符,需要进一步磋商成统一风格。

Yeah I mean code formatting. ESLint is the code formatting tool in JavaScript / frontend community.
If you plan to contribute a code formatting spec file, you have to make the spec similar to the code format in this repo.

Please use your tool to lint the repo, and submit all changes, making sure it does not change too much.

@purerosefallen purerosefallen mentioned this pull request Feb 21, 2025
@purerosefallen
Copy link
Collaborator

I noticed something about #2686 #2688 #2687 those PRs.

Are those PRs done by your lint tool? If so, please put all of them in this PR, rather than opening different PRs.

@yybbwc
Copy link
Contributor Author

yybbwc commented Feb 21, 2025

I noticed something about #2686 #2688 #2687 those PRs.

Are those PRs done by your lint tool? If so, please put all of them in this PR, rather than opening different PRs.

这些pr是用clang-tidy做的,不是用clang-format。
clang-tidy里的选项很多,多到了自相矛盾的程度,若是都放到一起,那单个pr的复杂度就太高了。

@purerosefallen
Copy link
Collaborator

I noticed something about #2686 #2688 #2687 those PRs.
Are those PRs done by your lint tool? If so, please put all of them in this PR, rather than opening different PRs.

这些pr是用clang-tidy做的,不是用clang-format。 clang-tidy里的选项很多,多到了自相矛盾的程度,若是都放到一起,那单个pr的复杂度就太高了。

It is a bit complicated, but adding linting tool and process is a huge change of our development, which is why I'm expecting to see all changes done by your linting tools in one single PR.

In addition, you seems to be doing a lot of changes. For proper daily discussions could you send me an email to [email protected] telling me who you are? I would invite you to our development chat.

@yybbwc
Copy link
Contributor Author

yybbwc commented Feb 21, 2025

In addition, you seems to be doing a lot of changes.

我只做了一些无关痛痒的小更改……
甚至整个项目的代码我都没读完……

For proper daily discussions could you send me an email to [email protected] telling me who you are? I would invite you to our development chat.

我主要是做残局的。
进了开发组也帮不上什么忙的样子。

@purerosefallen
Copy link
Collaborator

In addition, you seems to be doing a lot of changes.

我只做了一些无关痛痒的小更改…… 甚至整个项目的代码我都没读完……

For proper daily discussions could you send me an email to [email protected] telling me who you are? I would invite you to our development chat.

我主要是做残局的。 进了开发组也帮不上什么忙的样子。

Those PRs involving code styles and adding a lint system, matters a lot in development process. Because if applied, other contributors would be expected to learn how to use it, and make it compat with this lint tool, just like how the above 3 PRs work.

In addition, there are other related repos, such as server version https://github.com/mycard/ygopro/tree/server , should also be considered about how to fit in those code style changes. We expect contributors submitting bottom-level changes keep in touch with each other, to make dev process better and avoid conflict or communication errors.

@yybbwc
Copy link
Contributor Author

yybbwc commented Feb 21, 2025

我qq是1185538857,以前网名是顽雨沉风。

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants