Skip to content

Concat tool to master#1

Open
vkrava4 wants to merge 9 commits intomasterfrom
feature_1/concat_cmd
Open

Concat tool to master#1
vkrava4 wants to merge 9 commits intomasterfrom
feature_1/concat_cmd

Conversation

@vkrava4
Copy link
Copy Markdown
Owner

@vkrava4 vkrava4 commented Oct 18, 2020

No description provided.

- Initial Cobra setup
- Started validation / testing
- enhanced gitignore with idea exclusions
- Travis / codeclimate setup
- Building Validation logic
- small cleanup
- small cleanup
- finalising concat cmd
- added multi OS build to travis (linux and osx as for now)
@vkrava4 vkrava4 added the enhancement New feature or request label Oct 18, 2020
@vkrava4 vkrava4 self-assigned this Oct 18, 2020
Comment thread cmd/concat.go
if util.AskConfirmation(fmt.Sprintf("%d files found eligble for concatination. Would you like to procceed?", len(files))) {
var outputFile, errOutputFileCreate = os.Create(absOutput)

if errOutputFileCreate != nil {
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Avoid deeply nested control flow statements.

Comment thread util/input.go
"strings"
)

func AskConfirmation(message string) bool {
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

exported function AskConfirmation should have comment or be unexported

Comment thread cmd/concat.go
redColor = color.New(color.FgRed)
)

func RunConcatCmd(sources string, output string) *execution.Result {
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Function RunConcatCmd has a Cognitive Complexity of 38 (exceeds 20 allowed). Consider refactoring.

Comment thread cmd/concat.go
@@ -0,0 +1,138 @@
/*
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

package comment should be of the form "Package cmd ..."

Comment thread cmd/concat.go
redColor = color.New(color.FgRed)
)

func RunConcatCmd(sources string, output string) *execution.Result {
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

exported function RunConcatCmd should have comment or be unexported

- build fix
Comment thread cmd/concat.go
redColor = color.New(color.FgRed)
)

func RunConcatCmd(sources string, output string) *execution.Result {
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Function RunConcatCmd has 52 lines of code (exceeds 50 allowed). Consider refactoring.

Comment thread cmd/concat.go
return executionResult
}

func Validate(sourcesPath []string, output string) *validation.Result {
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

exported function Validate should have comment or be unexported

Comment thread cmd/root.go
@@ -0,0 +1,91 @@
/*
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

package comment should be of the form "Package cmd ..."

"github.com/vkrava4/k-toolkit/validation"
)

type Result struct {
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

exported type Result should have comment or be unexported

redColor = color.New(color.FgRed)
)

func (v *Result) PrintPretty() {
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

exported method Result.PrintPretty should have comment or be unexported

@qlty-cloud-legacy
Copy link
Copy Markdown

Code Climate has analyzed commit e2286d5 and detected 24 issues on this pull request.

Here's the issue category breakdown:

Category Count
Complexity 3
Style 20
Bug Risk 1

The test coverage on the diff in this pull request is 22.3% (80% is the threshold).

This pull request will bring the total coverage in the repository to 22.3%.

View more on Code Climate.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant