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

Get rid of missing newline error in clang. #45

Merged
merged 1 commit into from Jul 28, 2023

Conversation

tjni
Copy link
Contributor

@tjni tjni commented Jul 4, 2023

On Darwin, executing g++ runs clang, which emits an error when a C++ code block does not end in a newline. This is different from how g++ behaves on Linux.

This error doesn't add any value in the context of a code block in an RST file, so we just always add a newline to the C++ source code of a block to get rid of it.

Check List

Resolves: #19

  • I added tests for the changed code.
  • I updated the documentation for the changed code.
  • I ran the full tox test suite locally, so the CI pipelines should be green.
  • I added the change to the CHANGELOG.md file.

@Cielquan
Copy link
Contributor

I hope I can take a look at this within the next 2 weeks.

@Cielquan
Copy link
Contributor

I am unsure if always adding the new line will work on linux/win but the CI should error if it is indeed a problem.

@Cielquan
Copy link
Contributor

Cielquan commented Jul 26, 2023

can you add "macos" to docs/source/spelling_dict.txt to fix the spelling check error

@tjni tjni force-pushed the osx-linux-cpp-newline-diff branch 2 times, most recently from c84d32d to ff1ed39 Compare July 26, 2023 08:02
@tjni
Copy link
Contributor Author

tjni commented Jul 26, 2023

can you add "macos" to docs/source/spelling_dict.txt to fix the spelling check error

Done! Fingers crossed.

On Darwin, executing g++ runs clang, which emits an error when a C++
code block does not end in a newline. This is different from how g++
behaves on Linux.

This error doesn't add any value in the context of a code block in an
RST file, so we just always add a newline to the C++ source code of a
block to always get rid of it.
@tjni tjni force-pushed the osx-linux-cpp-newline-diff branch from ff1ed39 to edd6f42 Compare July 26, 2023 09:49
@Cielquan Cielquan merged commit 4ba0654 into rstcheck:main Jul 28, 2023
22 checks passed
@Cielquan
Copy link
Contributor

Cielquan commented Jul 28, 2023

Thanks for your work :)

I would like to add pydantic v2 support before a new release. There is another PR already. Hope to get to it soon.

@tjni tjni deleted the osx-linux-cpp-newline-diff branch July 28, 2023 07:18
@tjni
Copy link
Contributor Author

tjni commented Jul 28, 2023

Thank you for helping me merge this! Do you want me to open a PR on rstcheck as well fixing the tests in the same way so that you can merge it whenever you are ready to make that release?

@Cielquan
Copy link
Contributor

Cielquan commented Aug 2, 2023

Thank you for helping me merge this! Do you want me to open a PR on rstcheck as well fixing the tests in the same way so that you can merge it whenever you are ready to make that release?

Yes, that would be very helpful.

Cielquan added a commit to rstcheck/rstcheck that referenced this pull request Sep 9, 2023
- 1.1 includes bugfixes for errors in clang rstcheck/rstcheck-core#45
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.

[Bug]: Macos-specific tests failing on darwin in 1.0.2
2 participants