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

New Practice: Used Linter for C++ #419

Open
prokopsimek opened this issue Sep 30, 2020 · 28 comments
Open

New Practice: Used Linter for C++ #419

prokopsimek opened this issue Sep 30, 2020 · 28 comments

Comments

@prokopsimek
Copy link
Member

New Practice Proposal

Create a new practice that checks if is used linter for C++.

@prokopsimek prokopsimek self-assigned this Sep 30, 2020
@prokopsimek prokopsimek removed their assignment Sep 30, 2020
@shobhi1310
Copy link

Sir, can you assign me this issue, I want to work on this. 🙂

@prokopsimek
Copy link
Member Author

@shobhi1310 Hi! Thank you, the issue is yours. 👏

@adelkahomolova
Copy link
Contributor

@shobhi1310 Hi, how are you going? Do you need any help? :)

@shobhi1310
Copy link

I was having my semester quizzes, will resume from today again 😅

@adelkahomolova
Copy link
Contributor

Sure, no worries! Hope you were doing great in the quizzes ❤️ Let me know if you'll need any help.

@adelkahomolova
Copy link
Contributor

Hi, @shobhi1310 how is it going?

@shobhi1310
Copy link

@adelkahomolova
Ma'am, I resumed my work yesterday, sorry for the delay but semester exams were very brain draining. 😅

@shobhi1310
Copy link

image

I am setting up my environment but there is some issue regarding yarn. How to resolve it?

@shobhi1310
Copy link

image

Also under practices folder what folder name should I put for C++ like CPlusPlus or CPP ?

@adelkahomolova
Copy link
Contributor

Hi, @shobhi1310 , I don't know your operating system but the command with npm won't work. You have to follow the installation guide here - https://classic.yarnpkg.com/en/docs/install

Use the CPP as a name for a folder.

@shobhi1310
Copy link

My workspace OS is linux mint

@adelkahomolova
Copy link
Contributor

@shobhi1310 So choose in the link I sent you and follow the guide :)

@shobhi1310
Copy link

image

Ma'am,
How to tackle this issue ?

@adelkahomolova
Copy link
Contributor

Hi, @shobhi1310 , this is not an issue but expected behavior. There are commands you have to use as the help tells you. The command you have to run is yarn start run to run the dx-scanner.

@shobhi1310
Copy link

Thank you, ma'am, it runs perfectly now!

Which linter is to be used for C++?

@adelkahomolova
Copy link
Contributor

adelkahomolova commented Oct 19, 2020

I'm not a C++ developer and choosing the right linter is the part of the task. So you'll have to find it out on your own. Sorry. @shobhi1310 I'm sure you can do it :)

@shobhi1310
Copy link

image

https://github.com/caramelomartins/awesome-linters

I got reference of some widely used C++ linters out of which as per the organization's flavour cppcheck serves the purpose well enough.

@adelkahomolova
Copy link
Contributor

There are not only linters, but also some tools for making the code prettier. As I google it, I think you should check these three linters - cppcheck, oclint and clang-tidy. You can get the inspiration from GoLinterUsedPractice to how to check if there is at least one of them. @shobhi1310

@shobhi1310
Copy link

image

In the GoLinterUsedPractice spec file, why has typescript been put for 'If it is not Go' and what should I put for 'If it is not C++' ?

@shobhi1310
Copy link

Also, If I need to test it, should I run yarn start run or build using yarn build and then test using yarn test?

@adelkahomolova
Copy link
Contributor

It's because this is a test for the case if it's not Go language. So the different language is pasted to the test, so it's testing the method isApplicable() returns false in that case. You can use any of those languages that are not Go. E.g. Typescript.
To run tests, run the command yarn test. You can also specify the path to the test so only tests that you added are running. E.g. yarn test GoLinterUsedPractice.spec.ts. Is it clearer now? @shobhi1310

@shobhi1310
Copy link

shobhi1310 commented Oct 21, 2020

image

Ma'am, I got this after running a test on CPPLinterUsedPractise.spec.ts. It has passed the verification tests, but why is the 19.08 s showing red colour?

@shobhi1310
Copy link

shobhi1310 commented Oct 21, 2020

I will also make a PR today , do once review my code. And, should I also update the readme as well in the Practices section?

shobhi1310 added a commit to shobhi1310/dx-scanner that referenced this issue Oct 21, 2020
Checking for the following packages:

cppcheck.sourceforge.net/
github.com/oclint/oclint/

fixes: DXHeroes#419
shobhi1310 added a commit to shobhi1310/dx-scanner that referenced this issue Oct 21, 2020
Checking for the following packages:

cppcheck.sourceforge.net/
github.com/oclint/oclint/

fixes: DXHeroes#419
@adelkahomolova
Copy link
Contributor

It's just the information about the time the tests are running. No worries :)
Since there is no Component Detector for C++ yet, you don't have to add the practice to Readme. @shobhi1310

@shobhi1310
Copy link

image

Why did these 2 tests fail in Travis ?

@adelkahomolova
Copy link
Contributor

It's just exceeded the Github Rate limit. Nothing to worry about. @shobhi1310

@shobhi1310
Copy link

@adelkahomolova
Ma'am the purpose of checking practices in C/C++ would not be the same as that of in Go, Typescript, etc. mainly because of package managers not available in C/C++. 🤔

In that case would my PR not be merged? 🙄

@adelkahomolova
Copy link
Contributor

@shobhi1310 I have to discuss it with my colleagues.

@prokopsimek prokopsimek removed the Hacktoberfest https://hacktoberfest.digitalocean.com label Nov 5, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants