Commit Graph

11 Commits

Author SHA1 Message Date
Frederick Zhang afcbd1620e
Change checkstyle's output sub_type to style (#3780) 2021-07-04 21:31:00 +09:00
fwy 0a2ad516d4 Fix regexp pattern to work correctly in nvim and vim on windows and linux 2020-11-26 15:29:23 -06:00
Horacio Sanson 8fbcba0091 Fix 2913 - checkstyle config file ignored.
If checkstyle is configured with custom options that contain "-c" then
the checkstyle config file option is ignored. This PR modifies the
regular expression when creating the checkstyle command to avoid this.
2019-11-27 23:19:44 +09:00
Horacio Sanson eb6a7b7516 Fix checkstyle default configuration.
Checkstyle xml configuration is mandatory and not providing one causes
the tool to fail with the following error:

    Must specify a config XML file.

Checkstyle itself contains a default configuration as part of its
assests named `/google_checks.xml`. Invoking checkstyle with this config
works even if such file does not exists in the file system:

    checkstyle -c /google_checks.xml

This should be the default invocation to allow ALE to use checkstyle
with zero configuration.

Also when a user sets `g:ale_java_checkstyle_config` option, ALE should
use it to invoke checkstyle even such file does not exists in the
filesystem. This is because checkstyle is able to use configuration files
within JAR files defined in the CLASSPATH. The default `/google_checks.xml`
is an example of such configuration available within a JAR resource.
2019-06-12 10:53:28 +09:00
w0rp eb6015c6fd
#2542 - Improve checkstyle project configuration 2019-06-03 23:40:22 +01:00
Horacio Sanson 181bc69c8c Fix java checkstyle handler.
The checkstyle handler is capable of parsing the new and old output
formats. Unfortunately there are some particular output messages that
matched both the new and old regular expressions:

   [WARN] whatever:11:7: WhitespaceAround: ''if'' is not followed by whitespace. [WhitespaceAround]

This caused ALE to report extra errors since the message was being
matched twice, once as a warning and another (incorrect) old formatted
error.

This MR fixes this by stopping any parsing using the old format regexp
is any errors of the new format are correcly parsed. There is no reason
to expect checkstyle to output both styles in the same report.
2019-05-28 17:48:27 +09:00
w0rp 883978ece9
#2132 - Replace all uses of foo_callback with foo 2019-02-22 18:05:04 +00:00
Johannes Wienke 8e24a1a916 Let checkstyle only lint original files
Temporary files break checks like the one for a missing
package-info.java, as discussed in #1305.
2018-11-07 13:26:54 +01:00
Johannes Wienke 5d6b4ef73f Support older checkstyle versions
The output format used by older checkstyle versions differs from the one
of new versions. This commit adds a second parsing iteration on the
output lines with a suitable pattern to support both versions in
parallel. Due to the differences in the order of matching groups this is
hard to achieve in a single pass through the output lines.

An appropriate test case is added.
2018-11-07 13:25:48 +01:00
w0rp 7455e2e97d #852 - Capture error codes for checkstyle 2017-11-18 18:29:12 +00:00
Devon Meunier 9baae52d1a Add checkstyle linter 2017-05-15 15:41:04 -04:00