-
-
Notifications
You must be signed in to change notification settings - Fork 218
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
Added option to open stack overflow url directly, closes #191 #193
Added option to open stack overflow url directly, closes #191 #193
Conversation
Thank you for your first PR, I will review it shortly. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can we add some tests for this new argument? Please add it to socli/tests
Okay will add as soon as possible. |
@prathampowar2001 please take your time. |
Oh and I think Edit: resolved in commit after |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Tests LGTM 👍
@prathampowar2001 The travis tests are failing due to using |
I tested manually the functionality --open-url or -o with multiple urls
4.https://stackoverflow.blog/**** If a url does not contain https:// , eg. stackoverflow.com , It adds https:// to the start of it. If it is not a stackoverflow url it warns the user and opens in a browser. For a invalid url it check's it with a request module and if invalid then warns the user and exits I have manually tested with atleast 10-15 url's All the above is included in the next commit |
…l checks on my side
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good! 👍 I will test it again tomorrow if gautamkrishnar doesn't merge this today
Oh! Looks like it's failing codacy, you could just do a request.get without assigning it to a variable to resolve one of the unused variable issues. And then there seems to be trailing whitespaces on an if statement: https://app.codacy.com/manual/gautamkrishnar/socli/pullRequest?prid=5814058 |
It looks like all done and dusted . Thank you for the pain and effort you all took to correct my silly or sometimes irritating mistakes . And definately it was a learning experience for me as I contributed to a real open source project for the first time and learnt multiple things that would help me in the future . As a python and github newbie it was a very good experience . |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks better now 👍🏼 Even though the raising connection error might confuse someone reading it but I do not think that matters and can be fixed later, thank you for your effort 😃
Will probably be merged after @gautamkrishnar checks it again
@hedythedev @prashantchahal26 just updated the code and moved the requests.get after the |
Here is an overview of what got changed by this pull request: Complexity increasing per file
==============================
- socli/socli.py 11
Clones added
============
- socli/tests/test_socli.py 5
See the complete overview on Codacy |
@hedythedev really sorry for deleting your comment that was an accident. |
@all-contributors please add @prathampowar2001 for code |
I've put up a pull request to add @prathampowar2001! 🎉 |
@prathampowar2001 thanks a lot for the contribution. You rocks ⭐ |
* Added option to open stack overflow url directly , as refered in issue#191 * Added tests , Made some bug fixes , Made all discussed changes * Changed open_url to open-url * Changed multiple things, added support for invalid url and passing all checks on my side * Codacy checks passing * Optimised and refactored code * use generic Exception * Improve messages printed to the user Co-authored-by: Gautam krishna R <rgautamkrishna@gmail.com> Co-authored-by: Hedy Li <hedyhyry@gmail.com>
The Pull Request adds support for opening stackoverflow urls through socli.This was my first pull request so I worked on something that was easy.
If url is not eligible to open in socli , it opens in the browser . If url points to tag it opens the corresponding tag in socli.
If it is a normal question url it opens within socli.
To be just sure I also mentioned this in the Issues section.