mozilla / testpilot-metrics

Metrics broker library for Test Pilot experiments. Pings Google Analytics and Mozilla metrics servers
Mozilla Public License 2.0
3 stars 7 forks source link

Add ESLint #8

Closed pdehaan closed 7 years ago

pdehaan commented 7 years ago

Fixes #2

pdehaan commented 7 years ago

@6a68 I pushed a new commit and addressed feedback (hopefully)

👀

jaredhirsch commented 7 years ago

@pdehaan Looks great, but let's clean up the git history a bit:

  1. Start by getting rid of that merge commit:
git reset --hard HEAD~1

This will take the history from a tangled branchy thing (this is the gitk rendering of the history):

screen shot 2017-01-27 at 4 35 10 pm

back to a nice single line:

screen shot 2017-01-27 at 4 33 55 pm
  1. Next, squash all your commits together:
    git rebase -i HEAD~3

You'll see these three lines in your editor:

pick 1a13ad1 Add ESLint
pick 2fcf1f7 Fix tests and address PR feedback
pick 386994e Allow template literal string quotes

Change 'pick' to 's' for the bottom two:

pick 1a13ad1 Add ESLint
s 2fcf1f7 Fix tests and address PR feedback
s 386994e Allow template literal string quotes

Save and close the editor.

When the editor pops back open with all the commit messages shown, I think you'd be fine to just keep the 'Add ESLint' line. Save and close again, and git will squash the commits.

  1. Now, fetch mozilla's changes and rebase against master:
# assumes 'origin' is the name of your mozilla remote
]$ git fetch origin && git pull --rebase origin master

There will be one conflict, but it's an easy one to resolve. Edit testpilot-metrics.js:

<<<<<<< HEAD
   /**
   * Transforms `sendEvent()` arguments into a Google Analytics `Event` hit.
=======
  /**
   * Transforms `sendEvent()` arguments into a Google Analytics `event` ping.
>>>>>>> Add ESLint
   * @private
   * @param {string} method - see `sendEvent` docs
   * @param {string} [object] - see `sendEvent` docs

Resolve the conflict by getting rid of the <<< and >>> lines and the old description:

   /**
   * Transforms `sendEvent()` arguments into a Google Analytics `Event` hit.
   * @private
   * @param {string} method - see `sendEvent` docs
   * @param {string} [object] - see `sendEvent` docs

Save and close the editor.

Tell git you've fixed the conflict: git add testpilot-metrics.js && git rebase --continue.

At this point, the rebase should successfully finish, and the changes in this PR will be cleanly applied as a single commit on top of existing history:

screen shot 2017-01-27 at 5 03 12 pm

Once all that's done, force-push this branch and I'll land it :+1:

jaredhirsch commented 7 years ago

sweet! thx @pdehaan