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

Improve java checkstyle command configuration. #2542

Closed

Conversation

hsanson
Copy link
Contributor

@hsanson hsanson commented May 28, 2019

The g:ale_java_checkstyle_options only worked with absolute paths making
it difficult to have a per project configuration. This MR introduces a
new g:ale_java_checkstyle_config configuration. This option can be an
absolute path or a filename. When a filename is set then the nearest
file that matches it in the current buffer folder or any of its parents
will be used.

Note: The above is a breaking change since it replaces the
g:ale_java_checkstyle_options variable with a different one.

Also a new configuration g:ale_java_checkstyle_executable is added. This
allows users to create more specialized launch scripts (#1305) to invoke
checkstyle.

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 new options are fine, but keep the existing _options setting and change the default to ''. Some people will be using that option already. Check if the options contain -c, and use that instead if the configuration file is specified through the options, for maintaining backwards compatibility. We could add a deprecation warning so we can remove it later.

@w0rp w0rp added this to In Review in Old Working List via automation May 29, 2019
Horacio Sanson added 2 commits May 30, 2019 09:57
The g:ale_java_checkstyle_options only worked with absolute paths making
it difficult to have a per project configuration. This MR introduces a
new g:ale_java_checkstyle_config configuration. This option can be an
absolute path or a filename. When a filename is set then the nearest
file that matches it in the current buffer folder or any of its parents
will be used.

Note: The above is a breaking change since it replaces the
g:ale_java_checkstyle_options variable with a different one.

Also a new configuration g:ale_java_checkstyle_executable is added. This
allows users to create more specialized launch scripts (dense-analysis#1305) to invoke
checkstyle.
@hsanson hsanson force-pushed the 1305-improve-checkstyle-command branch from 0883b56 to 21fc3f5 Compare May 30, 2019 00:57
@hsanson
Copy link
Contributor Author

hsanson commented May 30, 2019

@w0rp Added the _options setting back. If defined I use this setting to build the command and ignore the new ones. If this option is defined is expected to have '-c' so no need to check for it. Also mentioned in the docs that the other settings are preferred over this one.

w0rp added a commit that referenced this pull request Jun 3, 2019
@w0rp
Copy link
Member

w0rp commented Jun 3, 2019

I rewrote this in the latest commit. It should support absolute paths for the configuration file in the new _config option, relative paths, prefer -c in _options if the configuration file is set in the options, and the executable is now configurable.

@w0rp w0rp closed this Jun 3, 2019
Old Working List automation moved this from In Review to Done Jun 3, 2019
@hsanson hsanson deleted the 1305-improve-checkstyle-command branch June 4, 2019 00:47
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

2 participants