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

Refactor: Use manual disambiguators for shared filenames #763

Merged
merged 8 commits into from Sep 13, 2017

Conversation

jneen
Copy link
Member

@jneen jneen commented Aug 24, 2017

This PR removes the use of analyze_text's numeric score interface, and adds a facility for specifying manual disambiguating cases. analyze_text has been renamed to detect?, which returns a boolean, and is only meant to detect unambiguous cases (like shebangs and doctype declarations).

@jneen
Copy link
Member Author

jneen commented Aug 24, 2017

This could break manual guessing for custom lexers, though the impact is minor - lexers using the old interface will have their analyze_text method ignored, and will never be detected by source.

@jneen
Copy link
Member Author

jneen commented Aug 24, 2017

But! This should give us a clearer way forward when languages share conflicting file extensions.

@jneen
Copy link
Member Author

jneen commented Aug 25, 2017

Okay, we're green now.

@gfx
Copy link
Member

gfx commented Aug 28, 2017

👏

Things are getting simpler!

@jneen
Copy link
Member Author

jneen commented Aug 30, 2017

(you are welcome to merge this as you like - there may be some minor backcompat issues, so i'll leave it to you to decide how to handle versioning and such)

@gfx gfx merged commit 5be8d6e into master Sep 13, 2017
@gfx gfx deleted the refactor.disambiguators branch September 13, 2017 03:15
@gfx
Copy link
Member

gfx commented Sep 13, 2017

Merged!

Will bump the major version of rouge for the next release.

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.

None yet

2 participants