Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

test: Add tests for fmt config options. #230

Merged
merged 1 commit into from
Oct 27, 2024
Merged

Conversation

wxsBSD
Copy link
Contributor

@wxsBSD wxsBSD commented Oct 26, 2024

This commit adds tests for the configurable formatter. Each configuration option is tested individually, as they each should be independent of each other. If we have a need to test multiple configuration options simultaneously in the future this setup should be able to do it easily.

While here I also found a bug in how tab stops were treated by the formatter when removing trailing whitespaces. After indentation was performed the step to remove trailing whitespace was not properly checking for the inserted tab characters.

There was also another bug with handling the emptyline before the section header which I fixed.

Also, fix a bug in the docs where the meta.align_values and meta.align_patterns options were incorrectly set. They changed to true in a previous commit but I did not update the docs then.

This commit adds tests for the configurable formatter. Each configuration option
is tested individually, as they each should be independent of each other. If we
have a need to test multiple configuration options simultaneously in the future
this setup should be able to do it easily.

While here I also found a bug in how tab stops were treated by the formatter
when removing trailing whitespaces. After indentation was performed the step to
remove trailing whitespace was not properly checking for the inserted tab
characters.

There was also another bug with handling the emptyline before the section header
which I fixed.

Also, fix a bug in the docs where the `meta.align_values` and
`meta.align_patterns` options were incorrectly set. They changed to true in a
previous commit but I did not update the docs then.
@wxsBSD wxsBSD changed the title Add tests for fmt config options. test: Add tests for fmt config options. Oct 26, 2024
@wxsBSD
Copy link
Contributor Author

wxsBSD commented Oct 26, 2024

I moved a lot of tests around for this, but I think it makes sense to separate out the "default" tests and the ones were we are testing configuration options for the formatter. Let me know if you don't like this change and I'll figure something out.

@plusvic plusvic merged commit 7cb64da into VirusTotal:main Oct 27, 2024
16 of 17 checks passed
plusvic pushed a commit that referenced this pull request Oct 27, 2024
This commit adds tests for the configurable formatter. Each configuration option
is tested individually, as they each should be independent of each other. If we
have a need to test multiple configuration options simultaneously in the future
this setup should be able to do it easily.

While here I also found a bug in how tab stops were treated by the formatter
when removing trailing whitespaces. After indentation was performed the step to
remove trailing whitespace was not properly checking for the inserted tab
characters.

There was also another bug with handling the emptyline before the section header
which I fixed.

Also, fix a bug in the docs where the `meta.align_values` and
`meta.align_patterns` options were incorrectly set. They changed to true in a
previous commit but I did not update the docs then.
@wxsBSD wxsBSD deleted the fmt_tests branch October 27, 2024 12:05
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants