1. 15 Apr, 2017 1 commit
  2. 11 Apr, 2017 5 commits
  3. 01 Apr, 2017 1 commit
    • Omair Majid's avatar
      Add an error-explainer for rpm-rpmlint · c71c92a7
      Omair Majid authored
      rpmlint's warnings/errors are very terse by default. For example, if
      the file contains the following:
      
          Source0: foobar.tar.xz
      
      The warning shown by flycheck is:
      
          invalid-url Source0: foobar.tar.xz
      
      The explainer helps clarify the root cause:
      
          invalid-url:
          The value should be a valid, public HTTP, HTTPS, or FTP URL.
      c71c92a7
  4. 24 Mar, 2017 1 commit
  5. 23 Mar, 2017 2 commits
  6. 22 Mar, 2017 2 commits
    • Philipp Baschke's avatar
      Add stylelint checker for CSS, SCSS and Less · 927ede51
      Philipp Baschke authored
      Define a checker for stylelint that parses JSON
      
      The stylelint CLI can format its output as text or JSON. The text
      formatter is not printing a severity keyword. That's why I used the JSON
      formatter and added a parser for the JSON output.
      
      See: https://stylelint.io/
      
      Show CssSyntaxErrors with checker css-stylelint
      
      When the CSS contains syntax errors and it is passed to the
      css-stylelint checker, the error output does not contain JSON data and
      therefore leads to a "checker probably flawed" error message. To avoid
      this error message and to show the user where the CSS syntax error is,
      the stylelint CssSyntaxError message is parsed and shown in the right
      position.
      
      I used the build in flycheck-parse-with-patterns and an error pattern in
      :error-patterns to introduce as little new functionality as possible.
      
      Show stylelint configuration errors in line 1
      
      A problem with the stylelint configuration is not returned in JSON
      format and has to be parsed with an error pattern aswell. The error
      pattern does not contain a line number. Because errors without line
      numbers can't be shown, an error-filter is needed to add a line number
      of 1. This filter also prepends the error message with "Configuration
      error: " to tell the user that the error occured because of a
      misconfiguration of stylelint.
      
      The flycheck-sanitize-errors filter is needed because the error-pattern
      for CssSyntaxErrors returns messages with unnecessary whitespace.
      
      Add config-file-var for stylelint checker
      
      The stylelint library has a good lookup mechanism for the default
      configuration, thats why the standard value of the config-file-var
      flycheck-stylelintrc is set to nil.
      See: http://stylelint.io/user-guide/configuration/#loading-configuration
      
      Enable css-stylelint in scss-mode
      
      stylelint can parse scss syntax (with postcss-scss) and can be used in
      scss-mode aswell. To avoid having to specify an extra checker (and
      duplicate some code), I decided to just activate the "--syntax" option
      of stylelint. It should work with normal css files aswell.
      
      Replace stylelint JSON parser with :error-patterns
      
      The CLI output of stylelint was improved and shows error severity now.
      To avoid adding custom code to flycheck the JSON parser can be replaced
      with error-patterns. This is possible because of these two PRs:
      
      - stylelint/stylelint#1023
        Show CssSyntaxErrors along the normal linter warnings (threw an
        Exception before)
      
      - stylelint/stylelint#1056
        Show an icon for severity and show rule name in extra column
      
      The :error-patterns cover the following scenarios:
      
      - Linting errors of any severity
        The severity is shown with an icon from the npm package log-symbols.
        These vary depending on the operating system (different icons for
        windows). Thats why the error and warning pattern contain two
        different symbols.
        See: https://github.com/sindresorhus/log-symbols
      
        It is possible to use custom severities in stylelint. The info pattern
        matches all linting errors with a severity other than error or
        warning. Info seems to fit best because the user could use error or
        warning otherwise.
      
      - Deprecation Warnings and Invalid Options
        The output also informs the user about deprecated rules and invalid
        configuration options. This helpful information is shown in the first
        line.
      
      - Errors
        Some things result in a thrown Error. For example, a missing
        configuration file, errors in the YAML or JSON file, no "rules"
        property in the configuration, using non-existent rules. Especially
        missing configurations files or errors in the configuration file seem
        likely. To avoid a flycheck error ("checker definition probably
        flawed") in these cases, their error message is shown in the first
        line.
      
      Add --quiet flag to css-stylelint syntax checker
      
      Most warnings can be automatically fixed and some user might not want
      to show them (the quiet flag only shows errors with severity "error").
      
      Replace :error-patterns with :error-parser
      
      All flycheck checkers should prefer structured output. That's why the
      stylelint JSON formatter with a custom :error-parser is the recommended
      way.
      
      The JSON parser gets deprecation warnings, invalid option errors and
      linting errors from stylelint and turns them into flycheck errors.
      
      stylelint sometimes throws errors and does not output JSON. The error
      parser handles this case and uses a regular expression to get an error
      message.
      
      Move stylelint for scss-mode in extra checker
      Add a stylelint checker for less-css-mode
      
      Save common args in a constant and use the same config and options
      variable in all checkers to reduce duplication.
      927ede51
    • fmdkdd's avatar
      Merge pull request #1206 from flycheck/rust-cargo-full-layout · 33df2571
      fmdkdd authored
      `rust-cargo` checks tests, examples and benches targets
      33df2571
  7. 19 Mar, 2017 4 commits
  8. 09 Mar, 2017 2 commits
  9. 08 Mar, 2017 1 commit
  10. 07 Mar, 2017 1 commit
  11. 02 Mar, 2017 1 commit
  12. 28 Feb, 2017 5 commits
  13. 23 Feb, 2017 1 commit
  14. 22 Feb, 2017 1 commit
    • Wilfred Hughes's avatar
      Treat 'note' from rustc as info, not error · ab308a84
      Wilfred Hughes authored
      Given a project that is configured as a staticlib:
      
          [lib]
          crate-type = ["staticlib"]
      
      rustc will output the following errors:
      
          $ cargo rustc -- --error-format=json
             Compiling foo v0.1.0 (file:///home/wilfred/tmp/foo)
          {"message":"link against the following native artifacts when linking against this static library","code":null,"level":"note","spans":[],"children":[],"rendered":null}
          {"message":"the order and any duplication can be significant on some platforms, and so may need to be preserved","code":null,"level":"note","spans":[],"children":[],"rendered":null}
          {"message":"library: dl","code":null,"level":"note","spans":[],"children":[],"rendered":null}
          {"message":"library: rt","code":null,"level":"note","spans":[],"children":[],"rendered":null}
          {"message":"library: pthread","code":null,"level":"note","spans":[],"children":[],"rendered":null}
          {"message":"library: gcc_s","code":null,"level":"note","spans":[],"children":[],"rendered":null}
          {"message":"library: c","code":null,"level":"note","spans":[],"children":[],"rendered":null}
          {"message":"library: m","code":null,"level":"note","spans":[],"children":[],"rendered":null}
          {"message":"library: rt","code":null,"level":"note","spans":[],"children":[],"rendered":null}
          {"message":"library: util","code":null,"level":"note","spans":[],"children":[],"rendered":null}
              Finished debug [unoptimized + debuginfo] target(s) in 0.17 secs
      
      Previously these would be treated as errors by flycheck.
      ab308a84
  15. 12 Feb, 2017 3 commits
  16. 09 Feb, 2017 3 commits
  17. 07 Feb, 2017 2 commits
  18. 06 Feb, 2017 3 commits
    • fmdkdd's avatar
      Use `--message-format=json` flag for rust-cargo checker · 3f05317c
      fmdkdd authored
      To get JSON output, rust-cargo used the `--error-format=json` flag of rustc.
      This had the downside of getting JSON output only from the *last* invocation of
      rustc by cargo.  Crucially, when compiling dependencies with errors, these
      errors would be reported as plain text rather than JSON, resulting in a
      suspicious checker state for rust-cargo.
      
      In the 1.13 release of Rust, Cargo added the `--message-format=json` to ensure
      all invocations of rustc would return JSON messages.  Unfortunately, the
      `--message-format` flag was not compatible with the `-Zno-trans` option that
      cuts down on compilation time by not generating an
      executable (rust-lang/cargo#3390).  This issue is fixed by release 1.15 of Rust.
      
      This commit changes rust-cargo to pass the `--message-format` flag instead of
      `--error-format`, ensuring that errors from dependencies are correctly turned
      into `flycheck-error` objects.
      
      Since Cargo merely encapsulates the JSON messages from rustc, this commits
      extracts the parsing of rustc diagnostics into its own function,
      `flycheck-parse-rustc-diagnostic`, to allow the new `flycheck-parse-cargo-rustc`
      and the existing `flycheck-parse-rust` (renamed `flycheck-parse-rustc`) to parse
      individual diagnostics.
      
      This commit also adds a test for the behavior that `--message-format` fixes over
      `--error-format`.  This required to instruct the flycheck-ert helpers to fail
      when a flycheck reported a suspicious checker state.
      
      Previously, a suspicious status would be printed out while running the tests,
      but would not mark the test as failed.
      
      This commits adds a hook to check for change in checker status and fails the
      test if the checker reports a suspicious status.
      3f05317c
    • fmdkdd's avatar
      Merge pull request #1167 from fap-/1166-add-asciidoctor-asciidoc-checker · bbf5653e
      fmdkdd authored
      Adds Asciidoctor as checker for AsciiDoc
      bbf5653e
    • fap's avatar
      Adds Asciidoctor as checker for AsciiDoc · b03c73c4
      fap authored
      b03c73c4
  19. 05 Feb, 2017 1 commit