-
Notifications
You must be signed in to change notification settings - Fork 3.2k
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
fix the way http verbs are defined #1598
Conversation
looks like I messed up on formatting. sorry. |
@flanneljesus I think that's a problem with your IDE. I don't think we should make code changes just to please someones code editor. Interestingly enough your IDE didn't showed you the eslint errors. |
would any IDE recognize things defined like that? I would be surprised; adding object properties in that method...that's how you add dynamically defined properties. Does your IDE recognize that? The linter settings for this project are very different from the default in my IDE (webstorm for what it's worth) and I don't know where to find the settings for this project. |
Ah, I found the eslint file in the root of the repo. Sorry for this, I'm new to making pull requests to other people's repos. Not trying to be an idiot. I would genuinely like to know if other IDEs recognize 'request.post' though. |
I added a new commit with the formatting fixed according to the package eslint file. |
@flanneljesus You are, by far, not the only person to miss the eslint and make a failing pull request 😆. Did you run As for the changes, 👍. I bet yours is not the only IDE that has trouble with this. Thanks for contributing! I hope the failing build didn't scare you off from future contributions to @simov I don't think we should not make code changes just to not please someone's editor. There were >9M downloads last month, so we should try to make it a pleasure to develop with |
@flanneljesus Feel free to squash together your two commits into one. That way there's less noise in the diffs, in the git blame, etc. Since no one else is tracking the flannelJesus/fix-verbs branch, it's not a faux-pas to rewrite history. In case you've never done this before, you can: Do an interactive rebase onto two commits before HEAD:
That opens your editor with this:
Then change the second
and save and quit. git will merge together the two commits into one and take the commit message from the first. Interactive rebase is super powerful. Instead of fixup, you can use squash (if you want to edit the commit message of the combined commit) or reword if you just want to change the commit message. You can also reorder commits (just by reordering the lines in this file) and squash together multiple commits (put multiple fixup/squash in a row). One thing I often do is find a typo from a few commits ago. In order to fix that, you add a new commit that fixes it, then do an interactive rebase and reorder the lines and change the new commit to fixup. It's like the typo never happened (again unless someone is tracking your branch, in which case rewriting history is ugly). There might be merge conflicts when you reorder commits, so be careful with that. After you change your history, you have to do a forced push to github:
This automatically updates the pull request! |
@froatsnook I'm not totally against that change as it's not that huge (for such issue). My point was that we already moved from The only constraint that I can think of is someone using WebStorm, or anyone else relying on codeintel plugin in their IDE. Anyway, we're not loosing that much in terms of DRYing up those methods, so I'll consider this PR as an actual fix. |
I changed the way they are defined so that they are more IDE-friendly. The way they were defined, an IDE wouldn't easily recognize them and would often show 'request.get' or 'request.post' etc as a possible error. Ctrl+clicking on the 'get' function wouldn't take you to where it was defined. Now it will!
Thank you froatsnook, I've done the rebase as you suggested. And thanks both of you for being patient with a...newb... I'm working on it 😉 |
@simov I definitely agree that the code shouldn't get worse to make editors happy. @flanneljesus I'm glad the rebase worked. It always makes me a bit nervous :). |
Fix the way http verbs are defined in order to please intellisense IDEs
Merged with one small final touch from me 👍 |
I changed the way they are defined so that they are more IDE-friendly. The way they were defined, an IDE wouldn't easily recognize them and would often show 'request.get' or 'request.post' etc as a possible error. Ctrl+clicking on the 'get' function wouldn't take you to where it was defined. Now it will!