These are chat archives for coala/coala-bears

13th
Nov 2018
Prashant Sharma
@gutsytechster
Nov 13 2018 07:31
@jayvdb wrt coala/coala-bears#2710
Isn't cppcheck and cppclean different?
And afaik CPPCheckBear uses Cppcheck
John Vandenberg
@jayvdb
Nov 13 2018 08:14
yup - correct, my apologies
Prashant Sharma
@gutsytechster
Nov 13 2018 08:20
Well, the issue here coala/coala-bears#2450 says that .h files are considered as C by default when using cppcheck. But I observed that that's the case in newer version not in older version.
So, if there is no such errors as in older versions, how should I write test cases compatible to older version(if I specifically talk about headerfiles)
John Vandenberg
@jayvdb
Nov 13 2018 08:24
the enhancement has nothing to do with .h files. it could be .foo files. the enhancement is to be able to specify the language
Prashant Sharma
@gutsytechster
Nov 13 2018 08:25
Okay so it's just about the use of language parameter!
Prashant Sharma
@gutsytechster
Nov 13 2018 09:18
No specific version of cppcheck has been specified in any requirements file. Which version of it should I consider. As when I run tests on my machine, they pass but on travis they fail.
John Vandenberg
@jayvdb
Nov 13 2018 10:21
ah . now I understand a bit better.
you should use the version which is installed into travis. read the travis log to find it. you can also add a version to the DistributionRequirement to record that
Prashant Sharma
@gutsytechster
Nov 13 2018 15:10
@jayvdb , I checked and get to know that coala uses Cppcheck 1.61.
I tried quite a few test files but language parameter doesn't seem to have any effect. I am not able to get any test case for it. I might be not getting the exact one. :|
Also, I was thinking that it's quite old version of Cppcheck that coala test uses. Shouldn't we upgrade the version?
Sharikzama
@ZamaSharik
Nov 13 2018 16:25
how do I test my changes? Should I navigate to the directory where I have made changes and type the command pytest ?
Abhinav Kaushlya
@abhishalya
Nov 13 2018 16:25
You can use pytest from the main directory
If you want to test only your changes then you can use py.test -k dir/test_file.py
Sharikzama
@ZamaSharik
Nov 13 2018 16:31
So if I have made changes to the file JSONFormatBear.py then to test it I need to use py.test -k coala-bears/tests/js/JSONFormatBearTest.py Right?
Abhinav Kaushlya
@abhishalya
Nov 13 2018 16:32
Redirect to coala-bears directory and use:
py.test -k tests/js/JSONFormatBearTest.py
Sharikzama
@ZamaSharik
Nov 13 2018 16:34
Thanks @abhishalya got it!
Sharikzama
@ZamaSharik
Nov 13 2018 17:29
So when I try to push my changes using the command git push --set-upstream origin JSONFormatBear I get the following error remote: Permission to coala/coala-bears.git denied to Sidsharik.
fatal: unable to access 'https://github.com/coala/coala-bears/': The requested URL returned error: 403
Abhinav Kaushlya
@abhishalya
Nov 13 2018 18:20
Yeah, please push to your own fork
@Sidsharik ^
Sharikzama
@ZamaSharik
Nov 13 2018 18:45
and how do I do that?
git push origin master ?
Abhinav Kaushlya
@abhishalya
Nov 13 2018 18:46
Do not mess with the master. Always create a new branch for the changes.
Bhawesh Bhansali
@bhawesh96
Nov 13 2018 18:46
Once you've checked out to your feature-branch, make your changes there and add, commit, git push origin <feature_branch_name>
Abhinav Kaushlya
@abhishalya
Nov 13 2018 18:46
Yeah ^
@Sidsharik You'll need to master git. Have a look here: https://api.coala.io/en/latest/Developers/Git_Basics.html
Sharikzama
@ZamaSharik
Nov 13 2018 18:55
I have 2 branches JSONFormatBear and master
I got this by using git branch command so I have an * sign on JSONFormatBear that means I am currently on it
Do I need to create a new branch as mentioned in the docs? I am following the docs.
Abhinav Kaushlya
@abhishalya
Nov 13 2018 19:13
No, that will do
So push now by git push origin JSONFormatBear
But make sure your fork is equal with the upstream, else rebase
Sharikzama
@ZamaSharik
Nov 13 2018 19:32
It still gives the same error! But, I've used this git push https://github.com/Sidsharik/coala-bears to resolve the problem.
Abhinav Kaushlya
@abhishalya
Nov 13 2018 19:32
Then you must have cloned the upstream repo
Clone your own fork, update it, make changes to it and then create a PR
Sharikzama
@ZamaSharik
Nov 13 2018 19:46
git clone -o upstream https://github.com/coala/coala-bears this was what I've used initially
as per documentation
Abhinav Kaushlya
@abhishalya
Nov 13 2018 19:49
Yeah, that's no problem. But then you'll have to add your fork as origin.
So, instead of doing that way, you can simply clone your own and set upstream to the upstream repo
Abhinav Kaushlya
@abhishalya
Nov 13 2018 20:33
@Sidsharik You created duplicate PRs coala/coala-bears#2782 and coala/coala-bears#2780
Please don't do this again.