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

Remove restriction on file extension for some parsers #128

Merged
merged 4 commits into from
May 22, 2024

Conversation

littleforest
Copy link
Contributor

@littleforest littleforest commented May 21, 2024

Problem

All files are now run through a parser's matches?
method, which is causing issues for the lcov,
gcov, and simplecov parsers since the
matches? method checks that files have a
particular file extension. This is causing failures
when users pass a custom file.

Solution

The lcov, gcov, and simplecov parsers were moved
to the last in the array of parsers, since they are
the only parsers which do not check actual
file contents to see if a file is of the correct
format. In order to ensure that these three
parsers will not erroneously match on files of
the other two types, we modify the matches?
method to return false if file extensions of the
other two parsers are matched.

If a user is passing a custom gcov, simplecov, or
lcov parser with a non-standard file extension, then
they must specify the --format parameter.

If the user does not specify a custom file, then
only files that match the extensions formerly listed
in the matches? method will be returned anyway
due to the globs method.

Closes #127

Problem
--------
All files are now run through the matches?
method, which is causing issues for the lcov,
gcov, and simplecov parsers since the
matches? method checks that files have a
particular file extension. This is causing failures
when users pass a custom file.

Solution
--------
Always return true for the matches? method
for lcov, gcov, and simplecov parsers. If the
user does not specify a custom file, then
only files that match the extensions listed in
this method will be returned anyway due to the
globs method. If a user specifies a custom
file, we do not want to exclude the file just
because it does not have the correct extension.
@littleforest littleforest requested a review from afinetooth May 21, 2024 20:29
Copy link
Member

@afinetooth afinetooth left a comment

Choose a reason for hiding this comment

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

🙏

Copy link
Member

@afinetooth afinetooth left a comment

Choose a reason for hiding this comment

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

Looks good! 🙏

Copy link

Pull Request Test Coverage Report for Build 9196041165

Details

  • 5 of 5 (100.0%) changed or added relevant lines in 3 files are covered.
  • No unchanged relevant lines lost coverage.
  • Overall coverage increased (+0.01%) to 93.983%

Totals Coverage Status
Change from base Build 9162110219: 0.01%
Covered Lines: 906
Relevant Lines: 964

💛 - Coveralls

@littleforest littleforest merged commit db18b31 into master May 22, 2024
11 checks passed
@littleforest littleforest deleted the loosen-matches-restriction-for-some-parsers branch May 22, 2024 18:20
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.

Coverall 0.6.11 stops parsing lcov files created by bazel
2 participants