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

Mark files under htmlcov/ as generated #6491

Merged
merged 4 commits into from
Sep 7, 2023

Conversation

spenserblack
Copy link
Contributor

@spenserblack spenserblack commented Jul 26, 2023

Description

This marks files generated by coverage.py, specifically the coverage html command, as generated. There are currently quite a lot of these files that are returned by GitHub's search, and it seems like the large majority come from this tool (more specific search results).

Checklist:

  • I am adding new or changing current functionality
    • I have added or updated the tests for the new or changed functionality.

@spenserblack
Copy link
Contributor Author

spenserblack commented Jul 26, 2023

I appear to be making some sort of (likely silly) mistake.
Tests fail, but running this locally seems to work fine (got the expected appears to be generated source code output for htmlcov/index.html).

# Doing this in Ruby returns `true`, too
Linguist::Generated.generated?('htmlcov/index.html', lambda { nil })

@spenserblack spenserblack marked this pull request as ready for review July 26, 2023 13:23
@spenserblack spenserblack requested a review from a team as a code owner July 26, 2023 13:23
@spenserblack spenserblack marked this pull request as draft July 26, 2023 13:43
@spenserblack
Copy link
Contributor Author

spenserblack commented Jul 26, 2023

Oh, of course. It helps to actually read the failure message 😅 Moved the check up the chain of ||s so that it's checked before any HTML, JS, or CSS is read.

Anyway, opening it back up for review. I'm anticipating that maybe some method renaming and/or combining with other methods may be requested 🙂

@spenserblack spenserblack marked this pull request as ready for review July 26, 2023 14:00
Copy link
Collaborator

@Alhadis Alhadis left a comment

Choose a reason for hiding this comment

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

Minor nitpick concerning naming; don't forget to move the method definition to its alphabetically-appropriate location in generated.rb Scratch that, the file's not ordered anyway. 😅

@@ -72,6 +72,7 @@ def generated?
generated_yarn_plugnplay? ||
godeps? ||
generated_by_zephir? ||
coveragepy_htmlcov_file? ||
Copy link
Collaborator

Choose a reason for hiding this comment

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

Nit: it makes more sense to name this htmlcov?, as the method doesn't involve anything more specific than pathname examination.

(If we checked for a substring like <!-- Generated by coverage.py v1.23 --> or what-have-you, then it might make more sense to tie this method to a specific utility).

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Good point, thanks!

lib/linguist/generated.rb Outdated Show resolved Hide resolved
spenserblack and others added 2 commits August 19, 2023 13:49
Co-authored-by: John Gardner <gardnerjohng@gmail.com>
@lildude lildude added this pull request to the merge queue Sep 7, 2023
Merged via the queue into github-linguist:master with commit 108fe81 Sep 7, 2023
5 checks passed
@spenserblack spenserblack deleted the htmlcov branch September 7, 2023 14:06
@github-linguist github-linguist locked as resolved and limited conversation to collaborators Jun 17, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants