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

Tests for New Lexers #1109

Closed
pyrmont opened this issue May 13, 2019 · 1 comment
Closed

Tests for New Lexers #1109

pyrmont opened this issue May 13, 2019 · 1 comment

Comments

@pyrmont
Copy link
Contributor

pyrmont commented May 13, 2019

As part of the effort to tidy up outstanding pull requests and merge them into a new branch, I've found myself coming across two issues relating to PRs for new lexers: one specific and one broad.

First, what should new lexers do if they define a filename that conflicts with a filename in an existing lexer? Should any PR that adds a lexer with a conflicting filename implement the self.detect? method on the new lexer? Does it need to implement the same method in the other lexer as well?

Second, is there a clear position about what tests new lexers should implement? I've looked through various lexers that are part of Rouge and there doesn't seem to be a consistent pattern. Most seem to test all filenames that are defined. Most seem to test all mimetypes that are defined. After that, it becomes a bit of a free for all.

/cc @jneen @dblessing @ashmaroli @vidarh

@pyrmont
Copy link
Contributor Author

pyrmont commented May 16, 2019

Based on discussion in this issue it sounds like the tests that should be implemented by a lexer are:

  1. a spec setting our expectations about filename globs, mimetypes and (if applicable) sources;
  2. a minimal demo file; and
  3. a more extensive visual sample.

On this assumption, I've drafted up documentation for lexer development and submitted it as #1111.

@pyrmont pyrmont closed this as completed May 16, 2019
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

No branches or pull requests

1 participant