You are viewing a plain text version of this content. The canonical link for it is here.
Posted to discuss-archive@tvm.apache.org by Manupa Karunaratne via TVM Discuss <no...@discuss.tvm.ai> on 2020/04/01 17:26:04 UTC

[TVM Discuss] [Questions] [CI][LINT] Enabling clang-format based lint checks


I have experienced that a considerable number of review cycles are spent fixing code-style issues that escapes the current linter. E.g., pointer formatting -- int* var vs int *var. Moreover, we have a .clang-format in TVM. I was wondering, Could there be some work done incoporating these two to enforce the code-style in the linter itself? I would like to hear your opinions on this.

cc : @zhiics @comaniac @leandron @masahi @matt-arm @tqchen





---
[Visit Topic](https://discuss.tvm.ai/t/ci-lint-enabling-clang-format-based-lint-checks/6170/1) to respond.

You are receiving this because you enabled mailing list mode.

To unsubscribe from these emails, [click here](https://discuss.tvm.ai/email/unsubscribe/fab00e3858b06b951ec139d0c4274193df25570b8cc6b463280b6a2b13fb20e4).

[TVM Discuss] [Development/RFC] [CI][LINT] Enabling clang-format based lint checks

Posted by Junru Shao via TVM Discuss <no...@discuss.tvm.ai>.

I think the cpplint is quite fast, so it won't hurt to have both, as long as they do not conflict





---
[Visit Topic](https://discuss.tvm.ai/t/ci-lint-enabling-clang-format-based-lint-checks/6170/10) to respond.

You are receiving this because you enabled mailing list mode.

To unsubscribe from these emails, [click here](https://discuss.tvm.ai/email/unsubscribe/b067c73671632c0fa4d449baf5bee832abf0c11835baa0d88bf95e449101065d).

[TVM Discuss] [Development/RFC] [CI][LINT] Enabling clang-format based lint checks

Posted by Krzysztof Parzyszek via TVM Discuss <no...@discuss.tvm.ai>.

Would clang-format replace cpplint, or would we have both?





---
[Visit Topic](https://discuss.tvm.ai/t/ci-lint-enabling-clang-format-based-lint-checks/6170/9) to respond.

You are receiving this because you enabled mailing list mode.

To unsubscribe from these emails, [click here](https://discuss.tvm.ai/email/unsubscribe/8a09e21a41cf205affa771ceda1b32d7a46b695cf238288594397f6aa319a3b2).

[TVM Discuss] [Development/RFC] [CI][LINT] Enabling clang-format based lint checks

Posted by tqchen via TVM Discuss <no...@discuss.tvm.ai>.

I will investigate around the next two available weekends(when impact to the CI will be lower)





---
[Visit Topic](https://discuss.tvm.ai/t/ci-lint-enabling-clang-format-based-lint-checks/6170/8) to respond.

You are receiving this because you enabled mailing list mode.

To unsubscribe from these emails, [click here](https://discuss.tvm.ai/email/unsubscribe/9aacca9d82bc33808940a7686e72925980d78f48870ad1fe6a0a8ed92970d649).

[TVM Discuss] [Development/RFC] [CI][LINT] Enabling clang-format based lint checks

Posted by Ramana Radhakrishnan via TVM Discuss <no...@discuss.tvm.ai>.

Maybe take the next steps ? 

1. Do a flag day clang-format rewrite and take the one time cost for every patch having a merge conflict ? 
2. Once we are clang-format clean,  we could have CI run clang-format and fail CI instantly if there is any change in the source base compared to the pull request ? At the same time we do this we recommend that developers use clang-format in their editors as part of the coding guidelines ? The [documentation](http://clang.llvm.org/docs/ClangFormat.html)  seems pretty comprehensive and the integration seems straight forward with quite a range of editors / IDEs.


regards
Ramana





---
[Visit Topic](https://discuss.tvm.ai/t/ci-lint-enabling-clang-format-based-lint-checks/6170/7) to respond.

You are receiving this because you enabled mailing list mode.

To unsubscribe from these emails, [click here](https://discuss.tvm.ai/email/unsubscribe/f148f91e9ec016e5bbd7b65d9a1ae5ded59e8700b5837809861bf2941e15b0f1).

[TVM Discuss] [Development/RFC] [CI][LINT] Enabling clang-format based lint checks

Posted by tqchen via TVM Discuss <no...@discuss.tvm.ai>.

To be clear, we are enforcing the Google C style via cpplint. Although the cpplint checks seems to be weaker than the clang-format





---
[Visit Topic](https://discuss.tvm.ai/t/ci-lint-enabling-clang-format-based-lint-checks/6170/6) to respond.

You are receiving this because you enabled mailing list mode.

To unsubscribe from these emails, [click here](https://discuss.tvm.ai/email/unsubscribe/e3ff55587885ff570d4d4af9af5310a53c67543cef2638a3ac11cb15aacf8da8).

[TVM Discuss] [Development/RFC] [CI][LINT] Enabling clang-format based lint checks

Posted by masahi via TVM Discuss <no...@discuss.tvm.ai>.

There was a related issue https://github.com/apache/incubator-tvm/issues/1732 that resulted in the introduction of .clang-format file. But we didn't do anything else to improve consistency of existing code or enforce the style for future code.





---
[Visit Topic](https://discuss.tvm.ai/t/ci-lint-enabling-clang-format-based-lint-checks/6170/5) to respond.

You are receiving this because you enabled mailing list mode.

To unsubscribe from these emails, [click here](https://discuss.tvm.ai/email/unsubscribe/34a17540675ce37b8b33d1579821cc9579def530b914d4d0bd8e4a41a58818a2).

[TVM Discuss] [Development/RFC] [CI][LINT] Enabling clang-format based lint checks

Posted by tqchen via TVM Discuss <no...@discuss.tvm.ai>.

Let us open the discussion open for a bit, if we agree that it is a good idea, we can carry it out during a weekend(when there is less on-going PRs).





---
[Visit Topic](https://discuss.tvm.ai/t/ci-lint-enabling-clang-format-based-lint-checks/6170/4) to respond.

You are receiving this because you enabled mailing list mode.

To unsubscribe from these emails, [click here](https://discuss.tvm.ai/email/unsubscribe/a554ac9c4cb37ea956087107895090d085fb176899340aa1b28a4d164ed217d2).

[TVM Discuss] [Questions] [CI][LINT] Enabling clang-format based lint checks

Posted by "Cody H. Yu via TVM Discuss" <no...@discuss.tvm.ai>.

@tqchen Is that possible for you to run clang-format for an entire code base so that we can add a checker to CI? If we have concerns to the correctness issues potentially could be introduced by clang-format, we might be able to assign few people to do so?





---
[Visit Topic](https://discuss.tvm.ai/t/ci-lint-enabling-clang-format-based-lint-checks/6170/3) to respond.

You are receiving this because you enabled mailing list mode.

To unsubscribe from these emails, [click here](https://discuss.tvm.ai/email/unsubscribe/862519c98ea3d78e5ea01603564903f693fe7e6eb3f60d021d782d94e9e31171).

[TVM Discuss] [Questions] [CI][LINT] Enabling clang-format based lint checks

Posted by masahi via TVM Discuss <no...@discuss.tvm.ai>.

A related PR with more discussion

https://github.com/apache/incubator-tvm/pull/5202





---
[Visit Topic](https://discuss.tvm.ai/t/ci-lint-enabling-clang-format-based-lint-checks/6170/2) to respond.

You are receiving this because you enabled mailing list mode.

To unsubscribe from these emails, [click here](https://discuss.tvm.ai/email/unsubscribe/ec9c5f9cfe7a4c579a4a318099352a2d109943be31285cc0e70b3ee06c7a45a8).

[TVM Discuss] [Development/RFC] [CI][LINT] Enabling clang-format based lint checks

Posted by tqchen via TVM Discuss <no...@discuss.tvm.ai>.

https://github.com/apache/incubator-tvm/pull/5572





---
[Visit Topic](https://discuss.tvm.ai/t/ci-lint-enabling-clang-format-based-lint-checks/6170/13) to respond.

You are receiving this because you enabled mailing list mode.

To unsubscribe from these emails, [click here](https://discuss.tvm.ai/email/unsubscribe/9122980aa4c890dd56cf1d15dbb5bd8129f90a328e3582662fab96d311232d3a).

[TVM Discuss] [Development/RFC] [CI][LINT] Enabling clang-format based lint checks

Posted by Ramana Radhakrishnan via TVM Discuss <no...@discuss.tvm.ai>.

clang-tidy certainly looks interesting as well as something deeper than clang-format and that is likely to help us with other aspects that we may be missing. However I'm probably a bit old-school and would probably be a bit more careful about clang-tidy -fix ... :) 

That might be the next step, though we may have to create a configuration file if there exists something like that for clang-tidy which is a derivative of the google coding style with any minor deviations we make.





---
[Visit Topic](https://discuss.tvm.ai/t/ci-lint-enabling-clang-format-based-lint-checks/6170/12) to respond.

You are receiving this because you enabled mailing list mode.

To unsubscribe from these emails, [click here](https://discuss.tvm.ai/email/unsubscribe/093e702a130cc57157d470ebeb4e0da084b36edf837491a34fc7332679c1e22e).

[TVM Discuss] [Development/RFC] [CI][LINT] Enabling clang-format based lint checks

Posted by Junru Shao via TVM Discuss <no...@discuss.tvm.ai>.

Thank you for the proposal! I think it is a great idea to have clang-format in the CI system to enforce coding styles. A quick question, shall we consider clang-tidy some day in the future?





---
[Visit Topic](https://discuss.tvm.ai/t/ci-lint-enabling-clang-format-based-lint-checks/6170/11) to respond.

You are receiving this because you enabled mailing list mode.

To unsubscribe from these emails, [click here](https://discuss.tvm.ai/email/unsubscribe/d8af75e449a0518caedd5c40fc979b1af5082a9d5d1d4bdb108c5898269b5c6d).