Skip to content

[NFC][SYCL] Make clang-format tolerate more LIT checks #5235

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

Merged
merged 3 commits into from
Jan 11, 2022

Conversation

MrSidims
Copy link
Contributor

Signed-off-by: Dmitry Sidorov [email protected]

@MrSidims MrSidims requested a review from bader December 28, 2021 09:13
@MrSidims MrSidims requested a review from a team as a code owner December 28, 2021 09:13
@bader bader requested a review from romanovvlad December 28, 2021 09:17
@bader
Copy link
Contributor

bader commented Dec 28, 2021

@MrSidims, @romanovvlad, the description of the PR added this exception promises something more than what we have implemented.

But disable the limit for comments containing specific keywords:
RUN, FAIL, REQUIRES, UNSUPPORTED, CHECK, expected-*

Do we want to fix the implementation to match the description?

@MrSidims
Copy link
Contributor Author

@MrSidims, @romanovvlad, the description of the PR added this exception promises something more than what we have implemented.

But disable the limit for comments containing specific keywords:
RUN, FAIL, REQUIRES, UNSUPPORTED, CHECK, expected-*

Do we want to fix the implementation to match the description?

I do believe, that the intention was to enable clang-format for C++ code in the tests. I'm not sure why we would like to follow clang-format for check/run strings and LLVM IR itself.

@bader
Copy link
Contributor

bader commented Dec 28, 2021

@MrSidims, @romanovvlad, the description of the PR added this exception promises something more than what we have implemented.

But disable the limit for comments containing specific keywords:
RUN, FAIL, REQUIRES, UNSUPPORTED, CHECK, expected-*

Do we want to fix the implementation to match the description?

I do believe, that the intention was to enable clang-format for C++ code in the tests. I'm not sure why we would like to follow clang-format for check/run strings and LLVM IR itself.

I think you are missing my point.
According to the description, the line limit should already be disabled for such comments.
But implementation doesn't match the description: if I read regular expression correctly, it disables the limit for the lines where specific keywords are followed by the space (e.g. word must end with it and not just contain) + there must be a colon after the keyword.

Another problem with this whole approach is that tests must use only standard FileCheck keywords and I don't see this rule to be harden by CI or some other way.

@bader
Copy link
Contributor

bader commented Dec 28, 2021

if I read regular expression correctly, it disables the limit for the lines where specific keywords are followed by the space (e.g. word must end with it and not just contain) + there must be a colon after the keyword.

"(RUN|FAIL|REQUIRES|UNSUPPORTED|CHECK) *:"

I think this matches a keyword followed by a colon with 0 or more spaces between them. Right?
Anyway, this doesn't match the description of the PR and we probably should fix this mismatch instead.

@MrSidims
Copy link
Contributor Author

MrSidims commented Dec 28, 2021

@bader please check out the newest approach, hope I did get you correctly.
I've also noted, that sub_buffer.cpp (fresh test) failed in pre-commit, investigating.

@bader
Copy link
Contributor

bader commented Dec 28, 2021

I suggest you test this change with 4bc20ab.

@MrSidims
Copy link
Contributor Author

@bader
Copy link
Contributor

bader commented Dec 28, 2021

Good.

@MrSidims MrSidims requested a review from bader December 28, 2021 21:04
Copy link
Contributor

@bader bader left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good enough for me. It's not perfect, but I don't think it's worth improving it before we see the need for this.
I'd like original author (@romanovvlad) to approve.

@MrSidims
Copy link
Contributor Author

@romanovvlad could you please take a look?

@romanovvlad
Copy link
Contributor

romanovvlad commented Jan 11, 2022

Good enough for me. It's not perfect, but I don't think it's worth improving it before we see the need for this. I'd like original author (@romanovvlad) to approve.

Agree, do not think it's common to use these keywords in regular comments. I'm OK with current solution.

@MrSidims MrSidims changed the title [NFC][SYCL] Make clang-format tolerate more test cases [NFC][SYCL] Make clang-format tolerate more LIT checks Jan 11, 2022
@bader bader merged commit 10bb541 into intel:sycl Jan 11, 2022
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.

3 participants