DXHeroes / dx-scanner

CLI tool that allows you to measure quality of a team work and an app based on your source code.
https://dxscanner.io
MIT License
81 stars 45 forks source link

New Practice: Used Linter for C++ #419

Open prokopsimek opened 4 years ago

prokopsimek commented 4 years ago

New Practice Proposal

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

shobhi1310 commented 4 years ago

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

prokopsimek commented 4 years ago

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

adelkahomolova commented 4 years ago

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

shobhi1310 commented 4 years ago

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

adelkahomolova commented 4 years ago

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

adelkahomolova commented 4 years ago

Hi, @shobhi1310 how is it going?

shobhi1310 commented 4 years ago

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

shobhi1310 commented 4 years ago

image

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

shobhi1310 commented 4 years ago

image

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

adelkahomolova commented 4 years ago

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 commented 4 years ago

My workspace OS is linux mint

adelkahomolova commented 4 years ago

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

shobhi1310 commented 4 years ago

image

Ma'am, How to tackle this issue ?

adelkahomolova commented 4 years ago

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 commented 4 years ago

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

Which linter is to be used for C++?

adelkahomolova commented 4 years ago

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 commented 4 years ago

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 commented 4 years ago

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 commented 4 years ago

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 commented 4 years ago

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 commented 4 years ago

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 commented 4 years ago

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 commented 4 years ago

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?

adelkahomolova commented 4 years ago

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 commented 4 years ago

image

Why did these 2 tests fail in Travis ?

adelkahomolova commented 4 years ago

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

shobhi1310 commented 4 years ago

@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 commented 4 years ago

@shobhi1310 I have to discuss it with my colleagues.