-
Notifications
You must be signed in to change notification settings - Fork 147
Migrate to Atom-Grammar-Tests #254
Conversation
4da7958
to
078642f
Compare
This is very cool. I'll leave merging to @50Wliu or @maxbrunsfeld but +1 from me. I'd like more comprehensive grammar fixtures though. I can generate you some more code for this later. |
@ambv, yep! I wanted to see if this would land before committing to more fixtures. Just working on this exposed quite a few gaps in the grammar (type annotations, punctuation, etc) |
spec/python-spec.coffee
Outdated
grammarTest path.join(__dirname, 'fixtures/grammar/syntax_test_python_lambdas.py') | ||
grammarTest path.join(__dirname, 'fixtures/grammar/syntax_test_python_typing.py') | ||
|
||
xdescribe "SQL highlighting", -> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I disabled this section since it was failing for me. Does this work for others?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ignore this. It runs fine and I removed it.
65de2b6
to
2764738
Compare
Also improved the Type declarations and added more syntax tests. |
Could this be moved into a separate PR? |
ba5baeb
to
2764738
Compare
Sure, will move to another PR: https://github.com/kevinastone/language-python/tree/typing-improvements |
a20c44f
to
4d5affe
Compare
package.json
Outdated
"devDependencies": { | ||
"coffeelint": "^1.10.1" | ||
"coffeelint": "^1.10.1", | ||
"atom-grammar-test": "^0.6.4" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I believe this needs to be in the dependencies section, or else tests won't run on atom/atom (atom/language-html@624139d). I don't think the situation has changed since that commit.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
weird. ok. fixed.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This looks ok to me. I'll let it sit for a while longer to see if @maxbrunsfeld has comments.
@50Wliu I'm pretty unfamiliar with the textmate grammars, so I'm good with this as long as it looks good to you. @kevinastone just to check - have you done manual testing of your grammar changes to verify that everything looks good visually? |
@maxbrunsfeld yeah, it renders better due to support for asterisks in args and kwargs. BeforeAfter |
Description of the Change
Introduce syntax tests to improve the test coverage. Anticipating changes for the tree-sitter migration (cc @maxbrunsfeld + @ambv), we'd benefit from having a more complete set of grammar tests to ensure compatibility. This begins developing those test fixtures.
This introduces a few syntax fixture files and fixes a bug with missing vararg and kwarg syntax highlighting.
Benefits
atom-grammar-test is a test helper to allow you to provide code snippets and examples that you annotate with the desired syntax rules. It makes it much easier to validate the grammar rules and allows parties to provide examples of missing of errant syntax highlighting.
Possible Drawbacks
Dependency on another package? It's been used by several atom language grammars to date.
Applicable Issues
N/A