aboutcode-org / fetchcode

A library to reliably fetch code via HTTP, FTP and version control systems. This project is sponsored by NLnet project https://nlnet.nl/project/vulnerabilitydatabase/ Google Summer of Code, nexB and others generous sponsors!
9 stars 18 forks source link

Add package registry support for Homebrew packages #40

Open TG1999 opened 4 years ago

TG1999 commented 4 years ago

Have a look at fetchcode/package.py , and try to implement the same for Homebrew packages.https://formulae.brew.sh/api/formula/a2ps.json, sample API URL.

iamsairus10 commented 4 years ago

I looked into the issue nexB/fetchcode#40 ....like package.py...we have to make a new file homebrew package with same code?or we have to do something else?

TG1999 commented 4 years ago

Hi @iamsairus10, You don't need to create a new file, check the structure of package.py, you have to create a route for homebrew packages like it is done for npm or PyPI packages.

iamsairus10 commented 4 years ago
Screenshot 2020-10-04 at 10 34 15 PM

Like this???

TG1999 commented 4 years ago
Screenshot 2020-10-04 at 10 34 15 PM

Like this???

Yes!!

iamsairus10 commented 4 years ago

what will be base path for this? https://formulae.brew.sh/api/formula/a2ps.json this one?

iamsairus10 commented 4 years ago
Screenshot 2020-10-09 at 3 45 03 PM

Is it okay??? Or any changes req?

TG1999 commented 4 years ago

It will be difficult for us, to check code like this, would you like to write some tests for it ?

iamsairus10 commented 4 years ago

yaa sure just guide me

TG1999 commented 4 years ago

Checkout tests/test_package.py file, and try to repeat same for npm or pypi

iamsairus10 commented 4 years ago

There is no file as tests/data/homebrew_mock_data.json... what should I do?

iamsairus10 commented 4 years ago

Also no file as homebrew.json

TG1999 commented 4 years ago

Create one ;)

iamsairus10 commented 4 years ago

How🥺??

iamsairus10 commented 4 years ago

@TG1999 I am still unable to find how to approach to create those file?

tushar912 commented 3 years ago

@TG1999 can I work on this

TG1999 commented 3 years ago

Sure go ahead

tushar912 commented 3 years ago

@TG1999 I made a PR for this https://github.com/nexB/fetchcode/pull/47 .Can you review.