These are chat archives for coala/coala-bears

14th
Jun 2018
John Vandenberg
@jayvdb
Jun 14 2018 00:10
@jsecrest , a simpler/dumber approach (which wont be quite as satisfying) would be to treat the file as just a json file, and restrict the length of the string literal data values in the json. This is similar to LineLengthBear , except that json values might be indented, and we want to limit the length of strings inside the json values
then it doesnt matter what language is inside those strings
@ishanSrt do you have a list of all setting annotations currently being used ?
moved to coala/coala-bears#2532
but can also discuss here
bool is implemented as a setting LOV with a hard-coded list of acceptable values, so that is one example of how to do it. I am sure we have other existing setting annotations which are LOVs, but I cant think of them off hand
Ishan Srivastava
@ishanSrt
Jun 14 2018 00:22

LOV?

do you have a list of all setting annotations currently being used ?

yes of the bears till the version of coala-bears that quickstart uses, quickstart now generates them on the fly

here is a PR: coala/coala-quickstart#250
here is the object that can be used/modified to extract that list https://github.com/coala/coala-quickstart/blob/bed7e51280f8aad3763efc4323a17967d7ae6019/coala_quickstart/coala_quickstart.py#L110
John Vandenberg
@jayvdb
Jun 14 2018 00:27
can you build the list for me please. I need to look through it to find examples which you can use for LOVs
the list of existing type annotations and what they do is something that could be added to the cEP . Each custom type annotation is something green mode will need to understand
Ishan Srivastava
@ishanSrt
Jun 14 2018 00:29
oh like typed_list
John Vandenberg
@jayvdb
Jun 14 2018 00:29
yes. need a list of them all
im looking for ones which are more like an LOV, and I will be able to spot them very quickly
this is strange:
$ git grep TRUE_STRINGS
coalib/misc/Constants.py:TRUE_STRINGS = ['1',
it is only defined and never used ??
Ishan Srivastava
@ishanSrt
Jun 14 2018 00:31
what is LOV?
John Vandenberg
@jayvdb
Jun 14 2018 00:31
LOV is list of values
$ git grep _STRINGS
coalib/misc/Constants.py:TRUE_STRINGS = ['1',
coalib/misc/Constants.py:FALSE_STRINGS = ['0',
Ishan Srivastava
@ishanSrt
Jun 14 2018 00:31
and most(i didn’t check for all of them yet) of those kinds accept a particular set of defined values
like the warnings to ignore for a linter etc
John Vandenberg
@jayvdb
Jun 14 2018 00:33
yup, and I want to see them so I can show you the solution
ok, type annotation language is one of them
that is a horribly complicated one, and it is a def instead of a class, so it doesnt expose the acceptable values
Ishan Srivastava
@ishanSrt
Jun 14 2018 00:39
I have got the list of every possible bear arg having an annotation
John Vandenberg
@jayvdb
Jun 14 2018 00:39
perfect , can you paste it somewhere
Ishan Srivastava
@ishanSrt
Jun 14 2018 00:48
typed_ordered_dict
typed_list
function path_list
function known_checkstyle_or_path
function language
function path
function path_or_url
those are all ^^ custom annotations
John Vandenberg
@jayvdb
Jun 14 2018 01:14
and typed_dict
anyway, I've dumped an example solution on the issue , using known_checkstyle_or_path as an example
and eventually we should change setting type bool to be implemented using the new system of LOV instead of custom part of StringConvertor
John Vandenberg
@jayvdb
Jun 14 2018 09:31
I think I have a bear unbreakage coala/coala-bears#2536
(commit message needs to be updated; will do that soon)
John Vandenberg
@jayvdb
Jun 14 2018 10:09
looks good. I've fixed the commit message and rebased on top of the pytest-timeout fix
John Vandenberg
@jayvdb
Jun 14 2018 12:04
John Vandenberg
@jayvdb
Jun 14 2018 14:31
coala/coala-bears#2536 now passing