CouchDB
  1. CouchDB
  2. COUCHDB-669

Minor code cleanup in couch_httpd_auth

    Details

    • Type: Improvement Improvement
    • Status: Resolved
    • Priority: Trivial Trivial
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: None
    • Component/s: None
    • Labels:

      Description

      While experimenting with a custom handler I found some code repeated several times. Figured I'd get my feet wet with both Couch and Erlang at the same time and submit a patch that removes the repetition. Please review and apply as you see fit.

        Activity

        Hide
        Paul Joseph Davis added a comment -

        Applied as of r915476.

        Show
        Paul Joseph Davis added a comment - Applied as of r915476.
        Hide
        Jan Lehnardt added a comment -

        Hi Joel,

        this is a good patch, you're doing it right

        Only a few comments:

        Line 39 of the patch adds a new empty line with one indenting level of spaces. It is customary to keep separate patches for code changes and whitespace changes, since code changes are hard to spot when you only change whitespace in a line. Now your whitespace is in an isolated place so it is hardly a big deal, but it can make larger patches hard to read. No biggie

        Secondly, we try to avoid trailing whitespace, so if you want to add a new empty line (which is fine), try not having extra spaces in there.

        In concise form, these are summed up in our coding guidelines: http://wiki.apache.org/couchdb/Coding_Standards

        Other than that the patch is looking good, thanks!

        Show
        Jan Lehnardt added a comment - Hi Joel, this is a good patch, you're doing it right Only a few comments: Line 39 of the patch adds a new empty line with one indenting level of spaces. It is customary to keep separate patches for code changes and whitespace changes, since code changes are hard to spot when you only change whitespace in a line. Now your whitespace is in an isolated place so it is hardly a big deal, but it can make larger patches hard to read. No biggie Secondly, we try to avoid trailing whitespace, so if you want to add a new empty line (which is fine), try not having extra spaces in there. In concise form, these are summed up in our coding guidelines: http://wiki.apache.org/couchdb/Coding_Standards Other than that the patch is looking good, thanks!
        Hide
        Joel Clark added a comment -

        Re-attached patch, removed unneeded get_user/1 overload.

        Show
        Joel Clark added a comment - Re-attached patch, removed unneeded get_user/1 overload.
        Hide
        Joel Clark added a comment -

        I've never submitted a patch to an open source project before, so please let me know if I did not do it correctly.

        Show
        Joel Clark added a comment - I've never submitted a patch to an open source project before, so please let me know if I did not do it correctly.

          People

          • Assignee:
            Paul Joseph Davis
            Reporter:
            Joel Clark
          • Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:

              Time Tracking

              Estimated:
              Original Estimate - 5m
              5m
              Remaining:
              Remaining Estimate - 5m
              5m
              Logged:
              Time Spent - Not Specified
              Not Specified

                Development