Comments (6)
The v3 fixtures should all be pretty-printed. I'll convert v2's tonight, going forward the v3 ones should all be pretty too.
from octokit.rb.
The primary purpose of the fixtures is to simulate a response from the GitHub API, so I'm against modifying them, to avoid masking parsing errors.
It's unclear to me exactly why people are reading the fixtures, but here are a couple alternatives to modifying them:
-
Recommend that users pipe the fixture data through prettify_json.rb, for example:
cat spec/fixtures/timeline.json | prettify_json.rb
-
Adding more details about what each method returns to the Octokit YARD documentation
-
Creating a separate directory of pretty-printed JSON responses, which aren't used by the specs.
Of the above options—all of which I'd prefer over modifying the existing fixtures—I would lean toward 2, however, since I don't understand the exact use case for reading the fixtures, that may or may not be an adequate solution. You tell me.
from octokit.rb.
PS: Here's an example of what better YARD documentation could look like: http://rdoc.info/gems/mtgox/0.6.0/MtGox/Client#sells-instance_method
Would something like that solve the problem?
from octokit.rb.
I'm reading them because I added octokit to my editor project and they come up when searching with Command-T and are pretty useful. I just ran it through the json prettifier myself.
I like number 1 the best, unless a conclusion is reached that pretty-printing doesn't significantly impair testing. I'll just go ahead and continue to do that (that's what I did). A rake task could be helpful, though.
from octokit.rb.
Okay, if that works I'm going to close this issue. If you write a rake task and submit a pull request, I'd be happy to take a look at it, but I think improving the documentation would be a better use of time.
from octokit.rb.
@sferik Good point, I hadn't considered that since majority of my work in the project has been with v3 of the API, which already returns data in a pretty format (see here for comparison: https://gist.github.com/1081629 ).
So in theory this will be moot when Octokit is fully converted to v3.
Also, If you have the jsonpretty gem installed you can just pipe into that: | jsonpretty
from octokit.rb.
Related Issues (20)
- [BUG]: `check_runs_for_check_suite` generates invalid path if a repo string is passed in HOT 1
- Karatbars
- [FEAT]: Add support for SARIF data upload
- [MAINT]: Extend TooManyRequests test to check that the error message still differentiates between primary & secondary rate limits.
- [FEAT]: Support for codespaces and dependabot secrets HOT 1
- [DOCS]: Broken link for request-reviewers-for-a-pull-request HOT 2
- [FEAT]: Support codespaces API HOT 1
- [FEAT]: Support for Environment based Repository Secrets HOT 1
- [FEAT]: Add methods for app webhooks HOT 1
- [BUG]: Fetch a given reference uses the wrong API HOT 5
- [FEAT]: add missing endpoints HOT 2
- [BUG]: OAuth token auth applies a different Authorization header than using curl or postman HOT 6
- [DOCS]: README and yardocs refer to deleted method `#create_authorization` HOT 1
- [FEAT]: Refresh a user's access token with refresh token HOT 1
- Test issue HOT 1
- [FEAT]: Support Org Secrets HOT 1
- Get Projects by personal access token-Must have admin rights to Repository HOT 1
- [FEAT]: Provide response types with Sorbet HOT 1
- [BUG]: HTTP caching middleware returns cached responses to wrong users HOT 4
- [BUG]: `list_app_installation_repositories` does not return `rels` HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from octokit.rb.