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

Racket linting using raco #2146

Merged
merged 10 commits into from
Jan 14, 2019
Merged

Racket linting using raco #2146

merged 10 commits into from
Jan 14, 2019

Conversation

anthonyquizon
Copy link
Contributor

Simple 'linter' that uses the same approach as neomake using raco expand and regular expressions to match output.

Will probably look into racket language server in the future.

Copy link
Member

@w0rp w0rp left a comment

Choose a reason for hiding this comment

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

The regex test looks good. Add a test for the executable and command. See :help ale-development.

call ale#assert#TearDownLinterTest()

Execute(The default command and executable should be correct):
AssertLinter 'raco', 'raco expand %s'
Copy link
Contributor Author

Choose a reason for hiding this comment

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

I initially just plugged my code from what was in the docs. However, the ale#Escape function wasn't working for me.
I assumed that this was because I was calling raco expand %s directly in ale#linter#Define under "command".

Execute(The default command should be correct):                                                                                                                                                                   
    " AssertLinter checks the executable and command.                                                                                                                                                               
    " Pass expected_executable, expected_command                                                                                                                                                                    
    AssertLinter 'some-command', ale#Escape('some-command') . ' --foo'

Copy link
Member

Choose a reason for hiding this comment

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

ale#Escape is used for a single file, not multiple separate arguments. In this case, it would be ale#Escape("raco")

Copy link
Contributor Author

@anthonyquizon anthonyquizon Dec 21, 2018

Choose a reason for hiding this comment

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

Yeah I tried that first.
AssertLinter 'raco', ale#Escape('raco') . ' expand %s'

Unfortunately, that gives me an error. Is there something I'm doing wrong?

 Starting Vader: /testplugin/test/command_callback/test_racket_raco_command_callback.vader                                                 
    (1/1) [EXECUTE] The default command and executable should be correct                                                                    
    (1/1) [EXECUTE] (X) ['raco', 'raco expand %s'] should be equal to ['raco', '''raco'' expand %s']  

@anthonyquizon
Copy link
Contributor Author

Ok I've reverted the test back to AssertLinter 'raco', 'raco expand %s' so tests pass now.

@w0rp w0rp merged commit d09e8bc into dense-analysis:master Jan 14, 2019
@w0rp
Copy link
Member

w0rp commented Jan 14, 2019

Cheers! 🍻

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

3 participants