Skip to content

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

Merged
w0rp merged 8 commits into
dense-analysis:masterfrom
tvatter:fixers-styler
Apr 23, 2019
Merged

w0rp merged 8 commits into
dense-analysis:masterfrom
tvatter:fixers-styler

Conversation

@tvatter

@tvatter tvatter commented Mar 28, 2019 •

Copy link
Copy Markdown
Contributor

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
Comment thread autoload/ale/fixers/styler.vim Outdated
@@ -0,0 +1,16 @@
" Author: tvatter <[email protected]>
" Description: Fixing R files with syler.

Copy link
Copy Markdown

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
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Just corrected

@w0rp w0rp left a comment

Copy link
Copy Markdown
Member

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

tvatter commented Apr 10, 2019

Copy link
Copy Markdown
Contributor Author
  • 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

w0rp commented Apr 10, 2019

Copy link
Copy Markdown
Member

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

@tvatter

tvatter commented Apr 18, 2019

Copy link
Copy Markdown
Contributor Author
  • I updated the documentation
  • I added a simple test that the custom option is passed to the fixer.

@tvatter

tvatter commented Apr 22, 2019

Copy link
Copy Markdown
Contributor Author

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

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

Copy link
Copy Markdown

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
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Right, thanks!

Copy link
Copy Markdown

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
Copy Markdown
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
@w0rp

w0rp commented Apr 23, 2019

Copy link
Copy Markdown
Member

Cheers! 🍻

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

Copy link
Copy Markdown

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

@tvatter

tvatter commented Apr 23, 2019

Copy link
Copy Markdown
Contributor Author

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