These are chat archives for coala/coala-bears

8th
Aug 2018
Sladyn
@sladyn98
Aug 08 2018 04:48
@jayvdb does the get_requirements functionsearch the bear objects in the CI script? Am I correct?
John Vandenberg
@jayvdb
Aug 08 2018 05:53
yup. it asks coala to load them, then the script looks at the REQUIREMENTS in each
John Vandenberg
@jayvdb
Aug 08 2018 13:07
replied
Kriti Rohilla
@kriti21
Aug 08 2018 13:12
Thanks
Sladyn
@sladyn98
Aug 08 2018 14:28
@jayvdb So i understood that every bear has a language property.So i thought of a solution that i would create a new function get_languages which would call all bear objects and then create a set of languages and put the bears in those languages.IS my approach correct?
John Vandenberg
@jayvdb
Aug 08 2018 14:32
sounds great
Sladyn
@sladyn98
Aug 08 2018 15:12
@jayvdb How would i get the bear names from the object
John Vandenberg
@jayvdb
Aug 08 2018 15:14
@sladyn98 see get_all_requirements , it is using bear.REQUIREMENTS . in that loop, add bear.LANGUAGES
to get the bear name, using bear.__class__.__name__
Sladyn
@sladyn98
Aug 08 2018 15:26
@jayvdb Yes i will and should i create a function for each language like python,java etc
get_python ,get_java
It would put all the bears for those languages in a set
then i would call those functions in a generate_language file
and create a new yaml and put those bears accordingly
Vaibhav Rai
@RaiVaibhav
Aug 08 2018 15:42
@sladyn98 does it feasible to create function for each language, and coala cover 54 language
:sweat_smile:
Sladyn
@sladyn98
Aug 08 2018 15:43
@RaiVaibhav Your right actually it wont be feasible
Sladyn
@sladyn98
Aug 08 2018 15:52
We could do something like this where we create a dictionary of languages and then add the bears one by one to it.
key = "python"
lang.setdefault(key, [])
lang.[key].append(bear_name)
@RaiVaibhav @jayvdb
Vaibhav Rai
@RaiVaibhav
Aug 08 2018 16:01
I will suggest you to open a PR with your best approach, as maintainers always review the code :P
Sladyn
@sladyn98
Aug 08 2018 16:05
Sure @RaiVaibhav