Coder Social home page Coder Social logo

danger-ktlint's Introduction

Hi there ๐Ÿ‘‹

danger-ktlint's People

Contributors

davidbertet avatar mataku avatar starkej2 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

danger-ktlint's Issues

Logs are polluting JSON output

We updated ktlint to latest version (0.50.0) recently, and Danger-ktlint started failing with a parsing error

!] Invalid Dangerfile file: unexpected token at 07:59:55.010 [main] WARN com.pinterest.ktlint.cli.internal.KtlintCommandLine - Lint has found errors than can be autocorrected using ktlint --format
...

Turns out, ktlint logs output are on stdout and are enabled with info by default.

They might have added a new log recently, but logs should be set to none as danger-ktlint is expecting json output

Can only run with inline mode on gitlab

Hi,

I think there's another issue that alludes to this issue but doesn't provide much context. When running with inline_mode: false the ktlint plugin fails as it appears to reference a github api here.

Output from danger:

Did you mean?  gitlab
	from /usr/local/bundle/gems/danger-8.4.2/lib/danger/plugin_support/plugin.rb:24:in `method_missing'
	from /usr/local/bundle/gems/danger-ktlint-0.0.5/lib/ktlint/plugin.rb:70:in `block (3 levels) in send_markdown_comment'
	from /usr/local/bundle/gems/danger-ktlint-0.0.5/lib/ktlint/plugin.rb:66:in `each'
	from /usr/local/bundle/gems/danger-ktlint-0.0.5/lib/ktlint/plugin.rb:66:in `block (2 levels) in send_markdown_comment'
	from /usr/local/bundle/gems/danger-ktlint-0.0.5/lib/ktlint/plugin.rb:65:in `each'
	from /usr/local/bundle/gems/danger-ktlint-0.0.5/lib/ktlint/plugin.rb:65:in `block in send_markdown_comment'
	from /usr/local/bundle/gems/danger-ktlint-0.0.5/lib/ktlint/plugin.rb:63:in `catch'
	from /usr/local/bundle/gems/danger-ktlint-0.0.5/lib/ktlint/plugin.rb:63:in `send_markdown_comment'
	from /usr/local/bundle/gems/danger-ktlint-0.0.5/lib/ktlint/plugin.rb:42:in `lint'
	from Dangerfile:4:in `eval_file'
	from /usr/local/bundle/gems/danger-8.4.2/lib/danger/danger_core/dangerfile.rb:311:in `eval'
	from /usr/local/bundle/gems/danger-8.4.2/lib/danger/danger_core/dangerfile.rb:311:in `eval_file'
	from /usr/local/bundle/gems/danger-8.4.2/lib/danger/danger_core/dangerfile.rb:204:in `block in parse'
	from /usr/local/bundle/gems/danger-8.4.2/lib/danger/danger_core/dangerfile.rb:201:in `instance_eval'
	from /usr/local/bundle/gems/danger-8.4.2/lib/danger/danger_core/dangerfile.rb:201:in `parse'
	from /usr/local/bundle/gems/danger-8.4.2/lib/danger/danger_core/dangerfile.rb:287:in `run'
	from /usr/local/bundle/gems/danger-8.4.2/lib/danger/danger_core/executor.rb:29:in `run'
	from /usr/local/bundle/gems/danger-8.4.2/lib/danger/commands/runner.rb:73:in `run'
	from /usr/local/bundle/gems/claide-1.1.0/lib/claide/command.rb:334:in `run'
	from /usr/local/bundle/gems/danger-8.4.2/bin/danger:5:in `<top (required)>'
	from /usr/local/bundle/bin/danger:25:in `load'
	from /usr/local/bundle/bin/danger:25:in `<main>'

Happy to help debug or provide more info

Thanks

Support multiple output files?

Hello,

We have multiple modules in our android app and we're using ktlint-gradle. It creates multiple output files for each subproject in their build directory. You can change output directory but you can't aggregate generated reports.

We want to use this danger plugin and with ktlint-gradle plugin but as far as i see, it's not possible use multiple report files. Is it possible to add a feature that gives support for multiple output files that matches with given regex?

Failed with Ruby3.2

Hello,

We use Ruby 3.2 and danger-ktlint failed.

plugin.rb:180:in `ktlint_result_files': undefined method `exists?' for File:Class (NoMethodError)
      if !report_file.nil? && !report_file.empty? && File.exists?(report_file)
                                                         ^^^^^^^^

Ruby3.2 obsoletes File.exists.
Ruby 3.2.0 Released

ktlint shell command missing quotes

Here, we're doing .join(' ') with single quotes, but it's missing the single quotes on the edges to ensure that the first and last arguments have start and end single quotes. It should look like this:

results = JSON.parse(`ktlint '#{targets.join(' ')}' --reporter=json --relative`

Specify ktlint limit for number of violations

Is it possible to specify the limit of errors that are printed in the comments for the Bitbucket server?
I see the option available but I get the error below.

[!] Invalid Dangerfile file: undefined method `limit=' for #Danger::Dangerfile:0x00007fe2e8060040\e[0m
from Dangerfile:66
ktlint.limit = 10 -> here.
ktlint.lint

Is there a better way of specifying options?

Gitlab support

is it just for github? or i can use it for gitlab too?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.