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

Adds code formatting check in the CI #21

Merged
merged 4 commits into from
Mar 27, 2023

Conversation

miguelteixeiraa
Copy link
Contributor

ref: ada-url/ada#170 and ada-url/ada#243 (comment)
Hello There! @lemire @anonrig
How do we proceed with the format of the whole codebase? Is there any big (code)change currently in progress for this repo? If not, can we run the format for all files?

@anonrig
Copy link
Member

anonrig commented Mar 22, 2023

I think you can format it in this pull request with an additional commit.

.github/workflows/lint_and_format_check.yml Outdated Show resolved Hide resolved
.github/workflows/lint_and_format_check.yml Show resolved Hide resolved
scripts/lint_and_format.py Show resolved Hide resolved
@anonrig
Copy link
Member

anonrig commented Mar 22, 2023

Should we remove the existing hooks? It doesn't seem to be necessary anymore.

@miguelteixeiraa
Copy link
Contributor Author

Should we remove the existing hooks? It doesn't seem to be necessary anymore.

Agreed!

@miguelteixeiraa
Copy link
Contributor Author

I just crashed everything yayyyy 😅
I'll figure it out when I have a little more time

@anonrig
Copy link
Member

anonrig commented Mar 23, 2023

I just crashed everything yayyyy 😅
I'll figure it out when I have a little more time

The order of imports in the header file broke it (which is a good thing because we did not include algorithms any other relevant libraries in the corresponding files)

@lemire
Copy link
Member

lemire commented Mar 23, 2023

If you reorder the include files, you may break the amalgamation. I recommend you do not reorder the include files.

@miguelteixeiraa
Copy link
Contributor Author

miguelteixeiraa commented Mar 23, 2023

If you reorder the include files, you may break the amalgamation. I recommend you do not reorder the include files.

Also, we would have problems with the includes order of idna.cpp, normalization.cpp, and probably more. Just added a SortIncludes: false to our .clang-format conf (probably have to also add it in ada)

@miguelteixeiraa
Copy link
Contributor Author

If you reorder the include files, you may break the amalgamation. I recommend you do not reorder the include files.

Also, we would have problems with the includes order of idna.cpp, normalization.cpp, and probably more. Just added a SortIncludes: false to our .clang-format conf (probably have to also add it in ada)

Actually I think they are all about the amalgamation like @lemire said. I can try to refactor the amalgamation script + related things to not depend on the import order if the current solution is not okay

@lemire
Copy link
Member

lemire commented Mar 25, 2023

There are still issues even if you preserve the original include order?

@miguelteixeiraa
Copy link
Contributor Author

There are still issues even if you preserve the original include order?

No issues when preserve the original includes order (don't know if it is in the original order now, but I can make it)

@lemire
Copy link
Member

lemire commented Mar 25, 2023

The exact order does not matter, but some orders will break the amalgamation script.

Copy link
Member

@anonrig anonrig left a comment

Choose a reason for hiding this comment

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

It seems the ordering issue is resolved.

@miguelteixeiraa
Copy link
Contributor Author

It seems the ordering issue is resolved.

That's correct.

@anonrig anonrig merged commit f6001f3 into ada-url:main Mar 27, 2023
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