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

Add strategy to identify Roff man pages: Take 2 #4433

Merged
merged 3 commits into from
Aug 12, 2019
Merged

Conversation

Alhadis
Copy link
Collaborator

@Alhadis Alhadis commented Feb 24, 2019

This PR adds a strategy to identify man-pages with unrecognised file extensions. Added in support of github/markup#1196.

Description

This was previously attempted in #4317, but ditched after the complexity of the PR convinced me a simpler solution was needed to safeguard against incorrectly rendered man-pages. That concern has since been addressed by #4393, leaving us free to adopt a much simpler implementation.

Note that the Manpage strategy deliberately returns two language entries, deferring the exact classification to the heuristics (which determine whether a Roff file should be rendered as a man-page or not).

References: #4258, #4309, #4317

/cc @pchaigno, @lildude, @jordemort, @pali

Checklist:

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

@lildude lildude requested a review from pchaigno March 5, 2019 17:47
@stale
Copy link

stale bot commented Apr 4, 2019

This pull request has been automatically marked as stale because it has not had recent activity, and will be closed if no further activity occurs. If this pull request was overlooked, forgotten, or should remain open for any other reason, please reply here to call attention to it and remove the stale status. Thank you for your contributions.

@stale stale bot added the Stale label Apr 4, 2019
@Alhadis Alhadis removed the Stale label Apr 5, 2019
@jordemort
Copy link

pls no close stalebot, I'll try and find a reviewer

@stale
Copy link

stale bot commented May 5, 2019

This pull request has been automatically marked as stale because it has not had recent activity, and will be closed if no further activity occurs. If this pull request was overlooked, forgotten, or should remain open for any other reason, please reply here to call attention to it and remove the stale status. Thank you for your contributions.

@stale stale bot added the Stale label May 5, 2019
@Alhadis Alhadis removed the Stale label May 6, 2019
@pali
Copy link

pali commented May 6, 2019

any update? :-)

@stale
Copy link

stale bot commented Jun 5, 2019

This pull request has been automatically marked as stale because it has not had recent activity, and will be closed if no further activity occurs. If this pull request was overlooked, forgotten, or should remain open for any other reason, please reply here to call attention to it and remove the stale status. Thank you for your contributions.

@stale stale bot added the Stale label Jun 5, 2019
@Alhadis Alhadis removed the Stale label Jun 5, 2019
@Alhadis
Copy link
Collaborator Author

Alhadis commented Jun 14, 2019

Nudging @lildude for input.

@Alhadis Alhadis requested a review from lildude June 14, 2019 07:42
@lildude
Copy link
Member

lildude commented Jun 14, 2019

From a quick look and based on your explanation, it makes sense to me, but I'll let @pchaigno take a peek and comment before making a final decision.

As an aside, you'll need to merge in master to get the tests passing as I fixed the current failure in #4478.

@Alhadis
Copy link
Collaborator Author

Alhadis commented Jun 14, 2019

Whoops, completely missed that. 😀 Fixed!

@Alhadis
Copy link
Collaborator Author

Alhadis commented Jun 20, 2019

Nudging @pchaigno.

@stale
Copy link

stale bot commented Jul 20, 2019

This pull request has been automatically marked as stale because it has not had recent activity, and will be closed if no further activity occurs. If this pull request was overlooked, forgotten, or should remain open for any other reason, please reply here to call attention to it and remove the stale status. Thank you for your contributions.

@stale stale bot added the Stale label Jul 20, 2019
@Alhadis
Copy link
Collaborator Author

Alhadis commented Jul 20, 2019

If somebody — anybody — could review this, shut stalebot up, and make many man-page lovers happy, that'd be seriously copacetic.

Seriously.

/cc @pchaigno again

@stale stale bot removed the Stale label Jul 20, 2019
Copy link
Contributor

@pchaigno pchaigno left a comment

Choose a reason for hiding this comment

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

I think the current regular expression is going to create issue with other languages (see below). I'm not sure how to best handle this. It's probably better if we avoid hardcoding the problematic extensions...

lib/linguist.rb Show resolved Hide resolved
lib/linguist/strategy/manpage.rb Show resolved Hide resolved
@Alhadis
Copy link
Collaborator Author

Alhadis commented Jul 21, 2019

It's probably better if we avoid hardcoding the problematic extensions...

Well, that can always be solved by generating a RegExp from at runtime from every extension which happens to start with a number.

But in any case, this shouldn't be a problem since the manpage-strategy has a lower priority than the filename one does, so "problematic" extensions shouldn't be a problem. 😉

Copy link
Contributor

@pchaigno pchaigno left a comment

Choose a reason for hiding this comment

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

LGTM!

@Alhadis
Copy link
Collaborator Author

Alhadis commented Jul 22, 2019

Merci! 😀

@lildude Alright to merge? ^^

@Alhadis
Copy link
Collaborator Author

Alhadis commented Aug 12, 2019

/cc'ing @lildude in case he's missed this.

@Alhadis Alhadis merged commit 2991273 into master Aug 12, 2019
@Alhadis Alhadis deleted the manpage-strategy branch August 12, 2019 11:20
@jordemort
Copy link

Yessssssssssss

@Alhadis
Copy link
Collaborator Author

Alhadis commented Aug 12, 2019

@jordemort Any update on github/markup#1196?

@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

5 participants