These are chat archives for coala/coala-bears

7th
Apr 2018
Ankit Joshi
@MacBox7
Apr 07 2018 05:34
@jayvdb regarding the changes is RadonBear. I know it won't be backward compatible but on the other hand it would be much easier to use by the new user. Previously it required that the user must have knowledge of radon to use this bear, but the new settings simply abstracts this and plus instead of returning a class value (again radon specific) it now returns the value of cyclomatic complexity itself.
John Vandenberg
@jayvdb
Apr 07 2018 05:34
yup; waiting for sils opinion on that
we dont do complexity well yet
John Vandenberg
@jayvdb
Apr 07 2018 05:49
ah much better
Nalin Bhardwaj
@nalinbhardwaj
Apr 07 2018 06:56
A feature request for GitCommitBear if anyone is up to implement it: ignoring all commits before a particular date/hash. It's not very optimal to use it otherwise for an existing repo.
John Vandenberg
@jayvdb
Apr 07 2018 07:00
hmm? it only should only be checking the top most commit ?
coala/coala-bears#2408 - a way to speed up travis builds
should be easy for anyone who is wanting to do a gsoc project regarding bears or dependency management
Nalin Bhardwaj
@nalinbhardwaj
Apr 07 2018 07:01
@jayvdb GitCommitBear only cares for latest commit? :O I thought it checks all commits not pushed to remote or something similar
John Vandenberg
@jayvdb
Apr 07 2018 07:02
it should only check the top most.
gitmate checks all commits from the branch point
Nalin Bhardwaj
@nalinbhardwaj
Apr 07 2018 07:03
So how does one use it on CI properly? If a PR/MR has multiple commits, nothing except top gets checked?
John Vandenberg
@jayvdb
Apr 07 2018 07:03
gitmate runs coala multiple times ;-)
Nalin Bhardwaj
@nalinbhardwaj
Apr 07 2018 07:03
Cool, thanks :)
John Vandenberg
@jayvdb
Apr 07 2018 07:06

coala/coala-bears#2408 - a way to speed up travis builds

ignore that; it is already done, by me. sigh

Nalin Bhardwaj
@nalinbhardwaj
Apr 07 2018 07:09
@jayvdb : Is there any particular reason for GitCommitBear only caring about top commit? It seems hard for me to use gitmate in the way my repo is maintained.
John Vandenberg
@jayvdb
Apr 07 2018 07:10
complexity i guess
I guess we would only ever want it to run from the branch point
but in that case why not run all of coala on each commit, which helps find style problems hidden in commits in the middle and fixed in latter commits
Nalin Bhardwaj
@nalinbhardwaj
Apr 07 2018 07:13
Right, so maybe this should be a "feature"? coala on all commits since last branch, and maybe warning on exceeding some reasonable limit of commits since branch?
John Vandenberg
@jayvdb
Apr 07 2018 07:14
or a commit hook , which automatically does it on each commit
Nalin Bhardwaj
@nalinbhardwaj
Apr 07 2018 07:16
Right, that's much more obvious. I'll use those, thanks :)
John Vandenberg
@jayvdb
Apr 07 2018 07:17
I think we have a bug about commit hooks, and I am pretty sure gitmate has some repos related to it
Nalin Bhardwaj
@nalinbhardwaj
Apr 07 2018 07:20
@jayvdb : can you elaborate, what's the bug? Docs don't seem to mention anything: http://docs.coala.io/en/latest/Users/coala_as_Git_Hook.html
John Vandenberg
@jayvdb
Apr 07 2018 07:30
hmm I cant find any bugs
but I suspect that most people would want coala --ci rather than coala
Nalin Bhardwaj
@nalinbhardwaj
Apr 07 2018 07:37
@jayvdb : yeah, maybe someone should update the docs too
Nalin Bhardwaj
@nalinbhardwaj
Apr 07 2018 07:46
Seems GitCommitBear also doesn't work for fixup commits, it needs to support those as well: https://robots.thoughtbot.com/autosquashing-git-commits
John Vandenberg
@jayvdb
Apr 07 2018 07:48
ahh! create a bug about that, and create an issue in projects to add that to one of our existing projects
Nalin Bhardwaj
@nalinbhardwaj
Apr 07 2018 08:03
@jayvdb : coala/coala-bears#2409 and coala/projects#548 created
John Vandenberg
@jayvdb
Apr 07 2018 08:15
thx
John Vandenberg
@jayvdb
Apr 07 2018 09:04
@virresh, how similar is hg remote syntax to git remote syntax ?
@sks444 has had a lot of success over at git-url-parse, and we might be able to propose hg syntax support if it isnt too disruptive
Viresh Gupta
@virresh
Apr 07 2018 09:18
From whatever mercurial I know of, hg has an awful support for modifying things from command line (everything needs to be specified in the hgrc), but for making a url parser probably we only need the list of remotes and not necessarily any way of modifying them, so I think
hg paths will list down all the remotes in our repository (equivalent of git remote -v)
which should be enough...
John Vandenberg
@jayvdb
Apr 07 2018 09:22
but is the syntax of the hg remote similar to that of git remotes?
that library is only a parser. if we get hg support added, we can use it for both git and hg links
it might even be sufficient now to correctly parse the hg links
the HgCommitBear doesnt need a strong parser, as it only cares about the hostname
Ankit Joshi
@MacBox7
Apr 07 2018 09:24
@jayvdb while fixing the URLBear I had gone through the python library you mentioned but the problem with it was that it gave false positives with HTML files and didn't extracted the protocol info(http, ftp, https, etc) and the vcs info (git+, etc.).
Viresh Gupta
@virresh
Apr 07 2018 09:29

but is the syntax of the hg remote similar to that of git remotes?

It is quite similar when it is about the hosts on the remote,
But it has a strange behaviour that allows path to local repository as well
(For e.g we have the absolute path to a hg repo, we can have a path added to that as well)

Ankit Joshi
@MacBox7
Apr 07 2018 09:30
Another query I had was regarding coala/coala-bears#2369. Should the proposed enhancement of checking issue link only work when the full url is given? Because i'll need this to query issue status using git API.
John Vandenberg
@jayvdb
Apr 07 2018 09:46
@virresh , a git remote can be a local path also, so that is not strange behaviour
Viresh Gupta
@virresh
Apr 07 2018 09:47
Oh
John Vandenberg
@jayvdb
Apr 07 2018 09:47
does the library properly support local paths? does hg support local paths?
Viresh Gupta
@virresh
Apr 07 2018 09:50
I will check the local path support in the library
And hg definitely supports local paths
Viresh Gupta
@virresh
Apr 07 2018 09:58

For the remote urls
A git remote from github is something like

<protocol>://<host>/<owner or org>/<reponame>.git

An hg remote bitbucket the url is

<protocol>://<username or vcs protocol>@<host>/<owner or org>/<reponame>

I think lot of similarity is there, but the existing regexes (in the library) won't suffice
Especially in the case we switch to something like ssh, then the git counterpart (from github) uses colons, but the hg ones remain the same

John Vandenberg
@jayvdb
Apr 07 2018 10:02
git remotes can have usernames
does the library support that yet ?
you probably want to experiment with the library a bit, to see if it is usable
Viresh Gupta
@virresh
Apr 07 2018 10:08
Yeah
I haven't checked out the library by retr0h
Was working with this one (with due regards to pip install giturlparse )
John Vandenberg
@jayvdb
Apr 07 2018 10:12
abandoned ; see who created these PRs
Viresh Gupta
@virresh
Apr 07 2018 10:16
Oh
I get it now
On to the new library now :sweat_smile:
John Vandenberg
@jayvdb
Apr 07 2018 10:29
@MacBox7, add notes on our issue, and raise issues upstream?
there are quite a few libraries that we can use. if we raise lots of bugs upstream, we'll find one library which agrees with our needs
Ankit Joshi
@MacBox7
Apr 07 2018 10:48
Ok will do. In the meantime can you help with GitCommitBear regarding the full url issue.
Viresh Gupta
@virresh
Apr 07 2018 10:58

@jayvdb
I played around with the new library,
It works great for hg urls as well without modifications

Although it doesn't work out well with absolute local paths, though I doubt anyone would need that...

John Vandenberg
@jayvdb
Apr 07 2018 10:58
link?
@virresh , create a bug :P
Viresh Gupta
@virresh
Apr 07 2018 10:58
xD
Sure
Also one more thing
John Vandenberg
@jayvdb
Apr 07 2018 10:59
and we dont need local paths, because the objective is to find the host, if it is bitbucket, nothing else really matters
Viresh Gupta
@virresh
Apr 07 2018 10:59
I was trying to check whether the pypi version works well for us or not
John Vandenberg
@jayvdb
Apr 07 2018 10:59
it doesnt. we've fixed it
Viresh Gupta
@virresh
Apr 07 2018 10:59
yeah
And found another interesting fork
John Vandenberg
@jayvdb
Apr 07 2018 10:59
now we need to get as many fixes in as possible, so we can fix them and get a solid release done
Viresh Gupta
@virresh
Apr 07 2018 11:01

So a coala release is on the way ?
or this is for the parser ?

now we need to get as many fixes in as possible, so we can fix them and get a solid release done

John Vandenberg
@jayvdb
Apr 07 2018 11:01
release for their library, because we cant use it until our fixes are released
Viresh Gupta
@virresh
Apr 07 2018 11:02
cool
John Vandenberg
@jayvdb
Apr 07 2018 11:02

https://github.com/nephila/giturlparse

nice find. vote up nephila/giturlparse#5 ,cc @sks444

https://github.com/gene1wood/fork-github-repo is interesting. cc @nkprince007
John Vandenberg
@jayvdb
Apr 07 2018 11:16
@virresh , mention your find on coala/coala-bears#2330 ; we'll go with the first decent library that is pip installable . ;-)
good to have multiple libraries which provide what we need. backup in case one maintainer goes awol
Viresh Gupta
@virresh
Apr 07 2018 11:17
Cool
John Vandenberg
@jayvdb
Apr 07 2018 11:25
@virresh and bump nephila/giturlparse#5 , cross linking to our issue
hoping to get some action happening
Viresh Gupta
@virresh
Apr 07 2018 11:27
Sure
John Vandenberg
@jayvdb
Apr 07 2018 12:48
do that, and I am happy
Damian Stachura
@damian1996
Apr 07 2018 12:50
@jayvdb I tried, but I had problem which I described in PR :)
John Vandenberg
@jayvdb
Apr 07 2018 12:55
ok, and replied to the other one, with another challenge :P
John Vandenberg
@jayvdb
Apr 07 2018 13:33
@damian1996 found an alternative solution for chktex https://github.com/coala/coala-bears/pull/2399#discussion_r179916786
Kriti Rohilla
@kriti21
Apr 07 2018 13:57
@jayvdb Please review coala/coala-bears#2364 and coala/coala#5119
John Vandenberg
@jayvdb
Apr 07 2018 14:58
@li-boxuan, you'll need to create an account on gitlab, to be added to new crazy place https://gitlab.com/coala/non-free-linter-bears
Shrikrishna Singh
@sks444
Apr 07 2018 14:58
though it doesn't support this behaviour yet:
>>> p = parse('https://github.com/sks444')
>>> p.repo
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
AttributeError: 'GitUrlParsed' object has no attribute 'repo'
Boxuan Li
@li-boxuan
Apr 07 2018 15:05
@jayvdb I've created an account and left a message here https://gitlab.com/coala/non-free-linter-bears/issues/1
Viresh Gupta
@virresh
Apr 07 2018 15:08

though it doesn't support this behaviour yet:

Just curious...
Are we using this kind of parsing in our bear ?
(And to me this looks like a problem of parsing github url rather than of a git repo url...)

Shrikrishna Singh
@sks444
Apr 07 2018 15:11
i have a pretty good comment by @jayvdb here https://github.com/retr0h/git-url-parse/pull/4#discussion_r177648880
also follow some of the conversations here https://gitter.im/coala/community?at=5abb23582b9dfdbc3a2d4fbb
John Vandenberg
@jayvdb
Apr 07 2018 15:15
https://github.com/sks444 is not a valid remote
never will be
that isnt a bug
the latter is a well known host
Shrikrishna Singh
@sks444
Apr 07 2018 15:28
yeah, so do we need to parse this https://example.com/sks444 in that library ?
assuming it to be a git remote url for a repo called sks444.git
John Vandenberg
@jayvdb
Apr 07 2018 15:32
only if you can find a real example to use in a bug request
Shrikrishna Singh
@sks444
Apr 07 2018 15:34
:+1:
@virresh have you tested https://github.com/nephila/giturlparse ?
installing this fork
Viresh Gupta
@virresh
Apr 07 2018 15:35
I have checked it locally
And it's there on pip as well
But not a proper release as mentioned in one of the issues
Shrikrishna Singh
@sks444
Apr 07 2018 15:36
yup i see that
can you check this ssh://user@example.com/owner/repo.git url on your machine ?
Viresh Gupta
@virresh
Apr 07 2018 15:37
sure

can you check this ssh://user@example.com/owner/repo.git url on your machine ?

None of the three attributes are returned positive by the library

Shrikrishna Singh
@sks444
Apr 07 2018 15:41
yeah
@jayvdb
@virresh it should pass right?
John Vandenberg
@jayvdb
Apr 07 2018 15:42
keep in mind what we need ... gitcommitbear only needs host; i.e. gitlab vs github vs bitbucket
and community repo only needs owner
other problems can be deferred to later
Viresh Gupta
@virresh
Apr 07 2018 15:43

@virresh it should pass right?

I think we only need to parse urls for known hosts for out GitCommitBear or HgCommitBear
So only github/gitlab/bitbucket are needed...

Though yes
It is an issue that should ideally be handled by a git url parsing library
John Vandenberg
@jayvdb
Apr 07 2018 15:44
we do need it to not create an exception for valid remotes , otherwise we cant extract the bigs we do need
that was the problem with git-url-parse -- it didnt accept remotes which didnt end in .git
Shrikrishna Singh
@sks444
Apr 07 2018 15:45
yeah, and we have fixed it now ;)
Viresh Gupta
@virresh
Apr 07 2018 15:50

Oh
This particular library focuses on only known hosts...
So probably cases that are not covered by the library will raise an exception with this library as of now...
(Although .git and no .git is supported)

Do we need this thing integrated (no exceptions during un-supported remote parsing) into the library that we will use in coala finally?

John Vandenberg
@jayvdb
Apr 07 2018 15:54
@virresh , at least for GitCommitBear, only known hosts are needed
and ideally , a .git/config with unknown hosts and known hosts will result in the known hosts being used, even if they are not the origin remote
Viresh Gupta
@virresh
Apr 07 2018 15:57

Yeah
And same for the future HgCommitBear....
Not sure if we are planning on something else...

Also probably related to this only, I had a doubt, should we form an algorithm to determine the master upstream from a given list of remotes ?

Or a warning that no host is supported is sufficient for our bears for now?
wrt to coala/coala-bears#2311
John Vandenberg
@jayvdb
Apr 07 2018 16:18

should we form an algorithm to ...

no, that needs to be done in another library.

I am already needing that in the community repo, and IGitt needs the same, as will other tools
and we need a consistent algorithm
Manan Kalra
@manankalra
Apr 07 2018 16:28
@jayvdb https://github.com/coala/coala-bears/pull/2335/files#r179727839
I've made changes to the gometalinter PR, take a look whenever you're free - coala/coala-bears#2335
Also, I'm unable to test a setting for it because of some problem with a linter that gometalinter supports - raised an issue here - alecthomas/gometalinter#458
Viresh Gupta
@virresh
Apr 07 2018 16:28

Oh
okay, so for that issue just a warning should suffice then ?

no, that needs to be done in another library.

John Vandenberg
@jayvdb
Apr 07 2018 16:31
@virresh , I created a separate bears issue about the hosted remote being not the first remote. we need to get an uptream library to support that
Viresh Gupta
@virresh
Apr 07 2018 16:31
Oh
Cool
Boxuan Li
@li-boxuan
Apr 07 2018 16:35
@jayvdb I accidentally clicked the Create merge request button on https://gitlab.com/coala/non-free-linter-bears/issues/1, and a merge request as well as a new branch got created automatically :worried: I manually deleted them. I would be careful with GitLab next time. Sorry for that. :worried:
John Vandenberg
@jayvdb
Apr 07 2018 16:37
no matter. developers are allowed to create branches
Viresh Gupta
@virresh
Apr 07 2018 17:10

@jayvdb @sks444
the maintainer seems to be content with the v0.9.1 release for giturlparse...

Not sure if we need the extra capabilities as per above discussion
or is the release good enough to be a dependency (works just well enough for GitCommitBear probably, not sure about any other factor involved)

Probably we wait for the other repo in which we fixed bugs ?

Ishan Srivastava
@ishanSrt
Apr 07 2018 17:36
how do i specify a bear to be a global bear in unittest?
Viresh Gupta
@virresh
Apr 07 2018 17:37

how do i specify a bear to be a global bear in unittest?

A bear inheriting from GlobalBear is global
I don't think we can turn it on/off for a unit test ?

Ishan Srivastava
@ishanSrt
Apr 07 2018 17:38
hmmm.. but we should not use already existing bears while writing tests
we should create our own dummy bears for our own tests
John Vandenberg
@jayvdb
Apr 07 2018 17:39
@virresh if it is on pypi, and it works, the only other consideration is if it has bad dependencies
e.g. does it depend on pytest or some other silly thing
Also check it has CI for 3.4
Viresh Gupta
@virresh
Apr 07 2018 17:40
Oh
Okay
It has no dependencies..
It runs without any dependency in my isolated virtual env
John Vandenberg
@jayvdb
Apr 07 2018 17:40
nice
Viresh Gupta
@virresh
Apr 07 2018 17:40
Cool
Will check about the CI thing
Viresh Gupta
@virresh
Apr 07 2018 17:43
Yeah
John Vandenberg
@jayvdb
Apr 07 2018 17:44
Ok, solved
@sks444 , does it solve the needs of 'community' repo?
Shrikrishna Singh
@sks444
Apr 07 2018 17:45
yeah, we only need owner and it is giving it us
for .git or not .git
but what we are going to about not supported valid urls for now?
John Vandenberg
@jayvdb
Apr 07 2018 17:47
Ok. Well we still have the build breakage to fix first
Shrikrishna Singh
@sks444
Apr 07 2018 17:47
yeah, i saw IGitt changes recently but not able to figure out
what is causing the problem
John Vandenberg
@jayvdb
Apr 07 2018 17:47
;)
Shrikrishna Singh
@sks444
Apr 07 2018 17:47
would be great if you could help
John Vandenberg
@jayvdb
Apr 07 2018 17:48
Any github or token commits?
Ask the gitmate guys for help :P
Im off to bed, and not coding tmr until late
Shrikrishna Singh
@sks444
Apr 07 2018 17:49

Any github or token commits?

a small one

but don't think that is causing the problem

Ask the gitmate guys for help :P

Alright, i will ping nkprince in community channel

John Vandenberg
@jayvdb
Apr 07 2018 18:04
use earlier commit in requiremebts.txt to check
Shrikrishna Singh
@sks444
Apr 07 2018 18:05
good idea ;)