dx-scanner icon indicating copy to clipboard operation
dx-scanner copied to clipboard

New Practice: Used Linter for C++

Open prokopsimek opened this issue 4 years ago • 28 comments

New Practice Proposal

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

prokopsimek avatar Sep 30 '20 10:09 prokopsimek

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

shobhi1310 avatar Oct 01 '20 04:10 shobhi1310

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

prokopsimek avatar Oct 01 '20 05:10 prokopsimek

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

adelkahomolova avatar Oct 07 '20 11:10 adelkahomolova

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

shobhi1310 avatar Oct 07 '20 14:10 shobhi1310

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

adelkahomolova avatar Oct 08 '20 07:10 adelkahomolova

Hi, @shobhi1310 how is it going?

adelkahomolova avatar Oct 16 '20 18:10 adelkahomolova

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

shobhi1310 avatar Oct 18 '20 05:10 shobhi1310

image

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

shobhi1310 avatar Oct 18 '20 06:10 shobhi1310

image

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

shobhi1310 avatar Oct 18 '20 06:10 shobhi1310

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.

adelkahomolova avatar Oct 18 '20 13:10 adelkahomolova

My workspace OS is linux mint

shobhi1310 avatar Oct 18 '20 14:10 shobhi1310

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

adelkahomolova avatar Oct 18 '20 14:10 adelkahomolova

image

Ma'am, How to tackle this issue ?

shobhi1310 avatar Oct 19 '20 11:10 shobhi1310

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.

adelkahomolova avatar Oct 19 '20 11:10 adelkahomolova

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

Which linter is to be used for C++?

shobhi1310 avatar Oct 19 '20 11:10 shobhi1310

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 :)

adelkahomolova avatar Oct 19 '20 11:10 adelkahomolova

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.

shobhi1310 avatar Oct 19 '20 12:10 shobhi1310

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

adelkahomolova avatar Oct 19 '20 14:10 adelkahomolova

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 avatar Oct 20 '20 10:10 shobhi1310

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

shobhi1310 avatar Oct 20 '20 10:10 shobhi1310

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

adelkahomolova avatar Oct 20 '20 12:10 adelkahomolova

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 avatar Oct 21 '20 07:10 shobhi1310

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 avatar Oct 21 '20 07:10 shobhi1310

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

adelkahomolova avatar Oct 21 '20 09:10 adelkahomolova

image

Why did these 2 tests fail in Travis ?

shobhi1310 avatar Oct 23 '20 08:10 shobhi1310

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

adelkahomolova avatar Oct 23 '20 15:10 adelkahomolova

@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? 🙄

shobhi1310 avatar Oct 23 '20 16:10 shobhi1310

@shobhi1310 I have to discuss it with my colleagues.

adelkahomolova avatar Oct 24 '20 16:10 adelkahomolova