Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Gitignore for GO lang #468

Merged
merged 11 commits into from
Oct 29, 2020
Merged

Gitignore for GO lang #468

merged 11 commits into from
Oct 29, 2020

Conversation

K-Kumar-01
Copy link
Contributor

Description

Created a new practice that checks correctly set .gitignore for Go lang.

Motivation and Context

The issue related to the PR is linked here

Types of changes

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to change)

Checklist:

  • I have updated the documentation accordingly.
  • I have added new practice to practice list in README.md.
  • I have read the CONTRIBUTING document.
  • I haven't repeated the code. (DRY)
  • I have added tests to cover my changes.
  • All new and existing tests passed.

@K-Kumar-01 K-Kumar-01 changed the title Giignore for GO lang Gitgnore for GO lang Oct 22, 2020
@adelkahomolova adelkahomolova changed the title Gitgnore for GO lang Gitignore for GO lang Oct 22, 2020
});

it('Does not change correct .gitignore', async () => {
const gitignore = `${basicGitignore}\npackage-lock.json\n`;
Copy link
Contributor

Choose a reason for hiding this comment

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

There is no package-lock.json in Go lang. Please, change it.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

we need to simply remove it or add any other file likt that of package-lock.json.

Copy link
Contributor

Choose a reason for hiding this comment

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

You can just remove the package-lock.json

src/practices/Go/GoGitignoreCorrectlySetPractice.ts Outdated Show resolved Hide resolved
src/practices/Go/GoGitignoreCorrectlySetPractice.ts Outdated Show resolved Hide resolved
src/practices/Go/GoGitignoreCorrectlySetPractice.ts Outdated Show resolved Hide resolved
src/practices/Go/GoGitignoreCorrectlySetPractice.ts Outdated Show resolved Hide resolved
src/practices/Go/GoGitignoreCorrectlySetPractice.ts Outdated Show resolved Hide resolved
Added appropriate comment headings
Changed the url
@adelkahomolova
Copy link
Contributor

@K-Kumar-01 , I appreciate the time you invest in our repository. I hope you enjoyed the contributing to DX-Scanner! It's approved by me. I'll just wait for a review from my colleague as we think it's the best practice to have 2 approvals to keep the high quality of code.
If you'll want to continue in contributing in open-source, check our other issues on dx-scanner. If you're good at writing, (or you just want to self-education) check our open-source Knowledge Base (here are the issues )
Take care of yourself in these complicated days! ❤️

expect(evaluated).toEqual(PracticeEvaluationResult.practicing);
});

it('Returns notPracticing if there the .gitignore is NOT set correctly', async () => {
Copy link
Collaborator

Choose a reason for hiding this comment

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

Returns notPracticing if the .gitignore is NOT set correctly

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Made the requested change in the latest push

@adelkahomolova
Copy link
Contributor

Screenshot 2020-10-26 at 14 20 56

Hi, @K-Kumar-01 , I noticed one test, which is failing. Can you fix it, please? :)

@K-Kumar-01
Copy link
Contributor Author

Screenshot 2020-10-26 at 14 20 56

Hi, @K-Kumar-01 , I noticed one test, which is failing. Can you fix it, please? :)

I have changed the sentence regrading this test case.
Let me know if any other change is needed.

@adelkahomolova
Copy link
Contributor

@K-Kumar-01 the test is not failing because there is bad text in the name of the test. You need to fix the code. The test is failing. I can't merge it since there is something bad.

@K-Kumar-01
Copy link
Contributor Author

@K-Kumar-01 the test is not failing because there is bad text in the name of the test. You need to fix the code. The test is failing. I can't merge it since there is something bad.

OK I will see to it and try to fix the problem.
I will let you know once i have made the changes

@K-Kumar-01
Copy link
Contributor Author

@adelkahomolova
I am not able to understand where i have to change the code as it is similar to other practices.
Can you tell me what should i change.
I did this though const basicGitignore = .exe\n.exe~\n*.dll\n*.so\n*.dylib\n*.test\n*.out\nvendor/\n;
thinking that newline characters may be a cause for the failing test cases.

@adelkahomolova
Copy link
Contributor

Hi, @K-Kumar-01 , I looked at it. The problem is that you check also the vendor, which is commented in the .gitignore. All comments are filtered out in the parseGitignore() method. You shouldn't check the vendor string.

@K-Kumar-01
Copy link
Contributor Author

@adelkahomolova The comment above vendor stated dependency directories. so i thought it shouldn't be a comment.
I have made the changes in new PR.
Let me know if there is any change needed.

@adelkahomolova adelkahomolova merged commit bf3cfac into DXHeroes:master Oct 29, 2020
@adelkahomolova
Copy link
Contributor

Thank you for the changes, @K-Kumar-01 , I've already merged your PR :)

@prokopsimek
Copy link
Member

🎉 This PR is included in version 3.45.1 🎉

The release is available on:

Your semantic-release bot 📦🚀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants