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

mix format new fixer for elixir lang #1017

Merged
merged 3 commits into from
Oct 24, 2017
Merged

Conversation

carakan
Copy link
Contributor

@carakan carakan commented Oct 20, 2017

the idea is to add support for new code formatter from elixir 1.6 (no yet released) but is usable compiling from master repository.

Let me know any suggestions, thanks for this awesome plugin.

@carakan carakan changed the title [WIP] mix format new fixer [WIP] mix format new fixer for elixir lang Oct 20, 2017
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 cool. See my comments here.

"
function! ale#elixir#Executable(buffer, executable) abort
let l:elixir = ale#elixir#GetExecutable(a:buffer)
if l:elixir ==# ''
Copy link
Member

Choose a reason for hiding this comment

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

Travis will tell you to use is# instead. I actually checked the difference in speed between x is# '' and empty(x) just now, and the former is a little faster, so I'll accept either for checking for empty strings.

Copy link
Member

Choose a reason for hiding this comment

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

I recommend moving all of this code into the file for the fixer instead.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

ok

" Author: carakan <carakan@gmail.com>
" Description: Functions for working with Elixir exec.

call ale#Set('elixir_executable', '')
Copy link
Member

Choose a reason for hiding this comment

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

It's unusual to have an executable option default to an empty string in the codebase. This option could be confused with an option for executing elixir for linting. You ought to default all executables to some name for something that can be found in PATH.

If you need to typically run mix instead of elixir mix, I recommend renaming this option to something like g:ale_elixir_mix_elixir_executable, or something. Then it should be okay for that to be an empty string by default, if mix is typically better than elixir mix.

Document the behavior of both options.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@w0rp you're right I'll delete the elixir option.

@carakan carakan force-pushed the elixir_format branch 2 times, most recently from b2c84a0 to 2f97afa Compare October 22, 2017 13:23
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.

This looks better. 👍 Could you add the new fixer to the documentation? You'll have to add the option to the README table, the list in the main documentation file, and some you'll have to document the option you added.

@carakan carakan changed the title [WIP] mix format new fixer for elixir lang mix format new fixer for elixir lang Oct 23, 2017
@carakan
Copy link
Contributor Author

carakan commented Oct 23, 2017

added documentation.

@w0rp w0rp added this to the Version 1.7 milestone Oct 23, 2017
@w0rp
Copy link
Member

w0rp commented Oct 23, 2017

Looks good! 👍 I shall merge this later.

I'm getting ready to release 1.6.0.

@w0rp w0rp merged commit 0e4dd95 into dense-analysis:master Oct 24, 2017
@w0rp
Copy link
Member

w0rp commented Oct 24, 2017

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.

2 participants