docs: Add Documentation for Using #fmt: skip with Equations in Black Formatter #64
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Summary of Changes
This PR updates the contributing.rst file to include information about the use of #fmt: skip tags for Black formatting exceptions for equations in the "caustics" project documentation.
Changes Made
Added a new section titled "Black Formatting Exceptions for Equations."
Provided information on how to use #fmt: skip for exempting specific code blocks from Black formatting.
Included best practices for using #fmt: skip with equations.
Example Usage
psi = (q2 * (x2 + self.s2) + y2).sqrt() # fmt: skip
Context
Maintaining consistent and readable code is crucial in the "caustics" project, and we use the Black code formatter for this purpose. However, there are scenarios where automatic formatting may interfere with the desired layout of equations. This PR introduces the use of #fmt: skip tags to selectively exempt equations from Black formatting.
Testing
Verified the changes locally by rendering the contributing.rst file and confirming that the new section is displayed correctly.