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 a fixer for r based on the styler package #2401

Merged
merged 8 commits into from
Apr 23, 2019
Merged

Add a fixer for r based on the styler package #2401

merged 8 commits into from
Apr 23, 2019

Conversation

tvatter
Copy link
Contributor

@tvatter tvatter commented Mar 28, 2019

Fixes #1483.

This is a simple fixer for R based on the styler package. It should solve #1483 and has also been requested elsewhere.

@tvatter tvatter changed the title Add a fixer for r based on the style package Add a fixer for r based on the styler package Mar 28, 2019
@w0rp w0rp added this to In Review in Old Working List via automation Mar 29, 2019
@@ -0,0 +1,16 @@
" Author: tvatter <thibault.vatter@gmail.com>
" Description: Fixing R files with syler.

Choose a reason for hiding this comment

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

There is a typo in syler.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Just corrected

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.

Looks good to me. Add it to the list of supported tools in the Markdown and Vim help files, and add a test for the fixer here. See :help ale-tests.

@tvatter
Copy link
Contributor Author

tvatter commented Apr 10, 2019

  • Re list of supported tools: no problem.
  • Re test: I already read that and kind of gave up since I don't know much about vim script. However, it should be noted that the styler R package is already the subject of many unit tests.

@w0rp
Copy link
Member

w0rp commented Apr 10, 2019

Have a look at existing tests for fixers, and the documentation which shows how to write a test.

@tvatter
Copy link
Contributor Author

tvatter commented Apr 18, 2019

  • I updated the documentation
  • I added a simple test that the custom option is passed to the fixer.

@tvatter
Copy link
Contributor Author

tvatter commented Apr 22, 2019

The tests dot not pass, but it's not due to my stuff right?

\ 'styler': {
\ 'function': 'ale#fixers#styler#Fix',
\ 'suggested_filetypes': ['r'],
\ 'description': 'Fix R files with styler.',
\ 'latexindent': {

Choose a reason for hiding this comment

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

Well I think you might be missing a } here?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Right, thanks!

Choose a reason for hiding this comment

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

Now tests pass, hooray 😄.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Indeed :)

@w0rp w0rp merged commit ce0b149 into dense-analysis:master Apr 23, 2019
Old Working List automation moved this from In Review to Done Apr 23, 2019
@w0rp
Copy link
Member

w0rp commented Apr 23, 2019

Cheers! 🍻

@tvatter tvatter deleted the fixers-styler branch April 23, 2019 18:51
@lorenzwalthert
Copy link

Thanks @tvatter. Do you want to tweet about it? I'll retweet.

@tvatter
Copy link
Contributor Author

tvatter commented Apr 23, 2019

Sure, I just did :)

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.

Adding fixer for R
3 participants