aviabird / gringotts

A complete payment library for Elixir and Phoenix Framework
https://hexdocs.pm/gringotts/Gringotts.html
MIT License
481 stars 53 forks source link

Small refactoring to fix credo linting warnings #182

Closed barthr closed 5 years ago

barthr commented 5 years ago

This pull requests refactors some of the code in the generator.

The command mix credo -a showed a list of warnings, and some of them were in the new.ex file.

The resolved warnings:

┃ [F] → Function is too complex (CC is 11, max is 9).
┃       lib/mix/new.ex:50:7 #(Mix.Tasks.Gringotts.New.run)
┃ [F] → Pipe chain should start with a raw value.
┃       lib/mix/new.ex:139 #(Mix.Tasks.Gringotts.New.prompt_with_suggestion)
┃ [F] → Pipe chain should start with a raw value.
┃       lib/mix/new.ex:102 #(Mix.Tasks.Gringotts.New.run)
┃ [F] → Pipe chain should start with a raw value.
┃       lib/mix/new.ex:97 #(Mix.Tasks.Gringotts.New.run)

This pull request also fixes issue #158

codecov-io commented 5 years ago

Codecov Report

Merging #182 into dev will not change coverage. The diff coverage is 0%.

Impacted file tree graph

@@           Coverage Diff           @@
##              dev     #182   +/-   ##
=======================================
  Coverage   77.39%   77.39%           
=======================================
  Files          14       14           
  Lines         376      376           
=======================================
  Hits          291      291           
  Misses         85       85
Impacted Files Coverage Δ
lib/mix/new.ex 0% <0%> (ø) :arrow_up:

Continue to review full report at Codecov.

Legend - Click here to learn more Δ = absolute <relative> (impact), ø = not affected, ? = missing data Powered by Codecov. Last update 3ff0bba...cbcde56. Read the comment docs.

barthr commented 5 years ago

Any update on this?

SagarKarwande commented 5 years ago

@barthr Thanks for the PR. If you feel like picking other issues, it would be great.

barthr commented 5 years ago

Sounds good! I will. This pull request also fixes #158 !