Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ImageDimensionBear #1260

Open
jayvdb opened this issue Jan 5, 2017 · 25 comments
Open

ImageDimensionBear #1260

jayvdb opened this issue Jan 5, 2017 · 25 comments

Comments

@jayvdb
Copy link
Member

jayvdb commented Jan 5, 2017

c.f #1259

fossasia/gci16.fossasia.org#239 was a feature request to add an image size linter.
FOSSASIA contributor @Abhi2424shek created the tool in fossasia/gci16.fossasia.org#467 .

History of it is split between https://github.com/fossasia/gci16.fossasia.org/commits/3ba48810d46416f32267c3f99f4d9498ac1399da/scripts/ImgChecker/ImgChecker.rb (with some enhancements by @ankitrgadiya) and https://github.com/fossasia/gci16.fossasia.org/commits/gh-pages/scripts/image_checker.rb after @robbyoconnor renamed it and radically improved it.

The current script is at:
https://github.com/fossasia/gci16.fossasia.org/blob/gh-pages/scripts/image_checker.rb

This issue is to create a coala bear with similar functionality.

@jayvdb
Copy link
Member Author

jayvdb commented Jan 5, 2017

Marking this as blocked, as ideally the authors of that tool come together and publish their code in a separate ruby gem, so it can be used by coala.

@robbyoconnor
Copy link

@jayvdb -- that script would need to be radically refactored to handle non-square dimensions...I have a few ideas on how to do this. I'll work on it later today.

@robbyoconnor
Copy link

The current script is highly specialized for FOSSASIA's GCI16 site -- I could probably make this more generic and package it up as a gem. I do not think this should be a GCI task -- students need to work on harder things right now...I'll help out with this one.

@robbyoconnor
Copy link

What would be REALLY cool with this bear existing is that it can actually resize the images for you!

@abishekvashok
Copy link
Contributor

abishekvashok commented Jan 5, 2017

Ok then @robbyoconnor sir go on, just take a turn to me when you are looking for a magical touch.

@jayvdb
Copy link
Member Author

jayvdb commented Jan 5, 2017

Polishing code so it is generic and packaging are a really useful set of skills, and a completely valid GCI task. I am happy to write it up. But the problem is authorship. You three need to decide on a license, repository location, etc, etc. That discussion can (and should) happen privately between the three of you -- not here please!

If you dont package the current ruby code, in a reasonable timeframe, I'll unblock this task and we'll write a generic tool in Python.

@abishekvashok
Copy link
Contributor

Is there a task for it @jayvdb

@robbyoconnor
Copy link

@Abhi2424shek -- if you wanna work on this -- I'll help you out -- the main reason I did what I did and rewrote it was I saw a lot of repeated code. I'd like that to remain.

As far as stuff I did to it - a lot of my work was simply DRY'ing up the code and bringing it in-line with the ruby style guide.

@robbyoconnor
Copy link

As far as license, it'd have to be GPL. It's a derivative work.

@robbyoconnor
Copy link

https://github.com/robbyoconnor/ImageSizeLinter/ -- we can pull it back into the GCI site afterwards

@robbyoconnor
Copy link

@jayvdb -- that work?

@abishekvashok
Copy link
Contributor

@robbyoconnor @jayvdb can I sir, but I think it's more good to create a repository and where we three of us (myself, @ankitrgadiya and @robbyoconnor) could code together and create the ruby gem there for this issue.

@robbyoconnor
Copy link

@Abhi2424shek -- hilariously -- it's never been frowned upon to queue up tasks... so go for it!

@abishekvashok
Copy link
Contributor

abishekvashok commented Jan 7, 2017

@jayvdb can you share the link to the gci task for us pls and the ruby gem would be ready by evening today IST

@jayvdb
Copy link
Member Author

jayvdb commented Jan 7, 2017

The task for the ruby gem was created a few days ago, and is still unpublished, but here is the link https://codein.withgoogle.com/tasks/5746072943067136/

The task for the coala bear which uses the ruby gem has just been created so it is also unpublished, but again here is the link https://codein.withgoogle.com/tasks/6269128656551936/

@abishekvashok
Copy link
Contributor

@jayvdb thanks we will just accept it when the task comes alive!

@abishekvashok
Copy link
Contributor

@jayvdb the gems published; link to repo: https://github/Abhi2424shek/img_checker

Install gem by: gem install img_checker

Check the gem: https://rubygems.org/gems/img_checker

@ananyo2012
Copy link

ananyo2012 commented Jan 10, 2017

@jayvdb Just being curious how are rubygems useful in the making of a bear? Also will this bear serve its purpose for linting in any language or will it be ruby specific? Pardon me if I am wrong saying anything as I am not acquainted with the working of coala-bears. I just seem to have a rough idea seeing the repository structure.

@robbyoconnor
Copy link

robbyoconnor commented Jan 10, 2017

@ananyo2012, In the same way that rubocop is used. It provides a means to get the linter. It allows others outside of coala to use it as well. It's a way to package it up.

@ananyo2012
Copy link

@robbyoconnor Yes use outside coala as a gem is fine. I was asking with relation to use in coala-bears. rubocop works as a ruby linter only. So is this something as ruby specific or can we use it in generalized way?

@robbyoconnor
Copy link

@ananyo2012 the linter happens to be a Ruby script. The Image Linter can be used outside of Ruby -- it literally checks the image dimensions (for now). It could be extended to check image size as well.

@nemani
Copy link
Member

nemani commented Jan 10, 2017

@ananyo2012 coala has a LinterBear subclass. Which can run any executable and parse its output.
I assume that this is what @robbyoconnor will use for this bear.

@robbyoconnor
Copy link

@nemaniarjun is correct. That's the reason it's packaged as a gem.

@jayvdb
Copy link
Member Author

jayvdb commented Jan 11, 2017

fwiw, a working prototype is at #1288

rhemon added a commit to rhemon/coala-bears that referenced this issue Jan 17, 2017
Added ImageDimensionBear.py in bears/general, that runs
the gem img_checker to see if images follow provided
dimensions.
Also added unittest for the bear, ImageDimensionBearTest.py
in tests/general

Closes coala#1260
rhemon added a commit to rhemon/coala-bears that referenced this issue Jan 17, 2017
Added ImageDimensionBear.py in bears/general, that runs
the gem img_checker to see if images follow provided
dimensions.
Also added unittest for the bear, ImageDimensionBearTest.py
in tests/general

Closes coala#1260
rhemon added a commit to rhemon/coala-bears that referenced this issue Jan 17, 2017
Added ImageDimensionBear.py in bears/general, that runs
the gem img_checker to see if images follow provided
dimensions.
Also added unittest for the bear, ImageDimensionBearTest.py
in tests/general

Closes coala#1260
rhemon added a commit to rhemon/coala-bears that referenced this issue Jan 17, 2017
Added ImageDimensionBear.py in bears/general, that runs
the gem img_checker to see if images follow provided
dimensions.
Also added unittest for the bear, ImageDimensionBearTest.py
in tests/general

Closes coala#1260
rhemon added a commit to rhemon/coala-bears that referenced this issue Jan 18, 2017
Added ImageDimensionBear.py in bears/general, that runs
the gem img_checker to see if images follow given
dimensions by user.
Also added unittest for the bear, ImageDimensionBearTest.py
in tests/general

Closes coala#1260
rhemon added a commit to rhemon/coala-bears that referenced this issue Jan 18, 2017
Added ImageDimensionBear.py in bears/general, that runs
the gem img_checker to see if images follow given
dimensions by user.
Also added unittest for the bear, ImageDimensionBearTest.py
in tests/general

Closes coala#1260
rhemon added a commit to rhemon/coala-bears that referenced this issue Jan 26, 2017
Added ImageDimensionBear.py in bears/general, that runs
the gem img_checker to see if images follow given
dimensions by user.
Also added unittest for the bear, ImageDimensionBearTest.py
in tests/general

Closes coala#1260
rhemon added a commit to rhemon/coala-bears that referenced this issue Jan 26, 2017
Added ImageDimensionBear.py in bears/general, that runs
the gem img_checker to see if images follow given
dimensions by user.
Also added unittest for the bear, ImageDimensionBearTest.py
in tests/general

Closes coala#1260
rhemon added a commit to rhemon/coala-bears that referenced this issue Jan 26, 2017
Added ImageDimensionBear.py in bears/general, that runs
the gem img_checker to see if images follow given
dimensions by user.
Also added unittest for the bear, ImageDimensionBearTest.py
in tests/general

Closes coala#1260
@jayvdb
Copy link
Member Author

jayvdb commented Apr 9, 2017

This bear could have been used to prevent coala/coala#4078 from being merged , and check coala/coala#4081 .

rhemon added a commit to rhemon/coala-bears that referenced this issue Jun 14, 2017
Added ImageDimensionBear.py in bears/general, that runs
the gem img_checker to see if images follow given
dimensions by user.
Also added unittest for the bear, ImageDimensionBearTest.py
in tests/general

Closes coala#1260
rhemon added a commit to rhemon/coala-bears that referenced this issue Jun 14, 2017
Added ImageDimensionBear.py in bears/general, that runs
the gem img_checker to see if images follow given
dimensions by user.
Also added unittest for the bear, ImageDimensionBearTest.py
in tests/general

Closes coala#1260
rhemon added a commit to rhemon/coala-bears that referenced this issue Jun 14, 2017
Added ImageDimensionBear.py in bears/general, that runs
the gem img_checker to see if images follow given
dimensions by user.
Also added unittest for the bear, ImageDimensionBearTest.py
in tests/general

Closes coala#1260
rhemon added a commit to rhemon/coala-bears that referenced this issue Jun 14, 2017
Added ImageDimensionBear.py in bears/general, that runs
the gem img_checker to check if images follow given
dimensions by user.
Also added unittest for the bear, ImageDimensionBearTest.py
in tests/general

Closes coala#1260
rhemon added a commit to rhemon/coala-bears that referenced this issue Jun 15, 2017
Added ImageDimensionBear.py in bears/general, that runs
the gem img_checker to check if images follow given
dimensions by the user.
Also added unittest for the bear, ImageDimensionBearTest.py
in tests/general

Closes coala#1260
rhemon added a commit to rhemon/coala-bears that referenced this issue Jun 16, 2017
Added ImageDimensionBear.py in bears/general, that runs
the gem img_checker to check if images follow given
dimensions by the user.
Also added unittest for the bear, ImageDimensionBearTest.py
in tests/general

Closes coala#1260
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Development

No branches or pull requests

8 participants