Skip to content

Conversation

@yeraydavidrodriguez
Copy link
Collaborator

This PR solves the GIT language issues described on #72 .

The problems were:

  • A localized string search on the git-repo::hasCommits method. This was replaced by examining the returning error code from a git log command.

  • Relying on SimpleGit to check if a dir contains an initialized repo. SimpleGit does not perform this test reliably (as described here), we fixed it by examining the returning error code from a git status command.

Additionally, we perform sanitization on the shell commands (by checking if the string passed to it is an actual dir) and we include this same test in the gitRepoDir class initialization.

@yeraydavidrodriguez yeraydavidrodriguez added the bug Something isn't working label Mar 9, 2022
@github-actions
Copy link

github-actions bot commented Mar 9, 2022

MegaLinter status: ⚠️ WARNING

Descriptor Linter Files Fixed Errors Elapsed time
✅ ACTION actionlint 5 0 0.17s
✅ COPYPASTE jscpd yes no 1.85s
✅ CREDENTIALS secretlint yes no 1.03s
✅ GIT git_diff yes no 0.02s
✅ JAVASCRIPT standard 1 0 0 1.49s
✅ JSON eslint-plugin-jsonc 7 0 0 1.01s
✅ JSON jsonlint 7 0 2.02s
✅ JSON prettier 7 0 0 1.38s
✅ JSON v8r 7 0 8.32s
⚠️ MARKDOWN markdownlint 2 0 1 0.4s
✅ MARKDOWN markdown-link-check 2 0 2.36s
✅ MARKDOWN markdown-table-formatter 2 0 0 0.35s
✅ SPELL cspell 81 0 3.92s
✅ SPELL misspell 81 0 0 0.17s
✅ TYPESCRIPT eslint 54 0 0 14.38s
✅ YAML prettier 8 0 0 1.65s
✅ YAML v8r 8 0 9.47s
✅ YAML yamllint 8 0 0.34s

See errors details in artifact MegaLinter reports on CI Job page

@yeraydavidrodriguez yeraydavidrodriguez force-pushed the issue-72-fix-git-language-bug branch from a58f0b5 to c501671 Compare March 9, 2022 14:27
@yeraydavidrodriguez yeraydavidrodriguez force-pushed the issue-72-fix-git-language-bug branch from c501671 to 6865a6b Compare March 9, 2022 14:29
Copy link
Member

@josecelano josecelano left a comment

Choose a reason for hiding this comment

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

hi @yeraydavidrodriguez it looks good to me but make sure we do not have any problem with relative paths.

@yeraydavidrodriguez yeraydavidrodriguez merged commit 0079b6e into main Mar 16, 2022
@yeraydavidrodriguez yeraydavidrodriguez deleted the issue-72-fix-git-language-bug branch March 16, 2022 07:48
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants