GitHub PullRequestReviewCommentEvent at 2014-04-09 18:55:24
Repository: watson
Actor: houndci
Payload: {"comment":{"url":"https://api.github.com/repos/strudelfish/watson/pulls/comments/11452539","id":11452539,"diff_hunk":"@@ -0,0 +1,755 @@\n+module Watson\n+  # Configuration container class\n+  # Contains all configuration options and state variables\n+  # that are accessed throughout watson\n+  class Config\n+\n+    class << self\n+      def home_conf\n+      # Return Conf object for $HOME/.watsonrc\n+        _home_conf = Watson::Config.new()\n+        _home_conf.rc_file = File.expand_path('~') + '/.watsonrc'\n+        _home_conf.read_conf\n+        return _home_conf\n+      end\n+    end\n+\n+\n+    # Include for debug_print\n+    include Watson\n+\n+    # [review] - Combine into single statement (for performance or something?)\n+    # [todo] - Add config options (rc file) for default max depth and context lines\n+\n+    # Location of .watsonrc, modified when working with remote API tokens\n+    attr_accessor :rc_file\n+\n+    # List of all files/folders to ignore when parsing\n+    attr_accessor :ignore_list\n+    # List of directories to parse\n+    attr_accessor :dir_list\n+    # List of all files to parse\n+    attr_accessor :file_list\n+    # List of tags to look for when parsing\n+    attr_accessor :tag_list\n+    # Tag format for look for\n+    attr_accessor :tag_format\n+    # List of custom filetypes to accept\n+    attr_accessor :type_list\n+    # Number of directories to parse recursively\n+    attr_accessor :parse_depth\n+    # Number of lines of issue context to grab\n+    attr_accessor :context_depth\n+\n+    # Flag for command line setting of file/dir to parse\n+    attr_accessor :cl_entry_set\n+    # Flag for command line setting of file/dir to ignore\n+    attr_accessor :cl_ignore_set\n+    # Flag for command line setting of tag to parse for\n+    attr_accessor :cl_tag_set\n+    # Flag for command line setting of showtype\n+    attr_accessor :cl_show_set\n+    # Flag for command line setting of output format\n+    attr_accessor :cl_output_set\n+    # Flag for command line setting of context depth\n+    attr_accessor :cl_context_set\n+    # Flag for command line setting of parse depth\n+    attr_accessor :cl_parse_set\n+\n+    # Entries that watson should show\n+    attr_accessor :show_type\n+\n+    # Flag for whether less is avaliable to print results\n+    attr_reader   :use_less\n+    # Flag for where the temp file for printing is located\n+    attr_reader   :tmp_file\n+\n+    # Count of number of issues found\n+    attr_accessor :issue_count\n+\n+    # Flag for whether remote access is avaliable\n+    attr_accessor :remote_valid\n+\n+    # Flag for whether GitHub access is avaliable\n+    attr_accessor :github_valid\n+    # GitHub API key generated from Remote::GitHub setup\n+    attr_accessor :github_api\n+    # GitHub Endpoint (for GitHub Enterprise)\n+    attr_accessor :github_endpoint\n+    # GitHub repo associated with current directory + watson config\n+    attr_accessor :github_repo\n+    # Hash to hold list of all GitHub issues associated with repo\n+    attr_accessor :github_issues\n+\n+\n+    # Flag for whether Bitbucket access is avaliable\n+    attr_accessor :bitbucket_valid\n+    # Bitbucket API key generated from Remote::Bitbucket setup (username for now)\n+    attr_accessor :bitbucket_api\n+    # Bitbucket password for access until OAuth is implemented for Bitbucket\n+    attr_accessor :bitbucket_pw\n+    # Bitbucket repo associated with current directory + watson config\n+    attr_accessor :bitbucket_repo\n+    # Hash to hold list of all Bitbucket issues associated with repo\n+    attr_accessor :bitbucket_issues\n+\n+    # Flag for whether Asana access is avaliable\n+    attr_accessor :asana_valid\n+    # Asana API Key\n+    attr_accessor :asana_api\n+    # Asana workspace\n+    attr_accessor :asana_workspace\n+    # Asana project within the workspace to place issues\n+    attr_accessor :asana_project\n+    # Hash to hold list of all Asana issues associated with repo\n+    attr_accessor :asana_issues\n+\n+\n+    # Flag for whether GitLab access is avaliable\n+    attr_accessor :gitlab_valid\n+    # GitLab API key generated from Remote::GitHub setup\n+    attr_accessor :gitlab_api\n+    # GitLab Endpoint (for GitHub Enterprise)\n+    attr_accessor :gitlab_endpoint\n+    # GitLab repo associated with current directory + watson config\n+    attr_accessor :gitlab_repo\n+    # Hash to hold list of all GitLab issues associated with repo\n+    attr_accessor :gitlab_issues\n+\n+    # Formatter\n+    attr_accessor :output_format\n+\n+    ###########################################################\n+    # Config initialization method to setup necessary parameters, states, and vars\n+    def initialize\n+\n+    # [review] - Read and store rc FP inside initialize?\n+    # This way we don't need to keep reopening the FP to use it\n+    # but then we need a way to reliably close the FP when done\n+\n+      # Identify method entry\n+      debug_print \"#{self.class} : #{__method__}\\n\"\n+\n+      # Program config\n+      @rc_file    = \".watsonrc\"\n+      @tmp_file     = \".watsonresults\"\n+\n+      @parse_depth  = 0\n+      @context_depth  = 15\n+\n+      # State flags\n+      @cl_entry_set  = false\n+      @cl_tag_set    = false\n+      @cl_ignore_set = false\n+      @cl_show_set   = false\n+      @cl_output_set = false\n+\n+      @show_type = 'all'\n+\n+      # System flags\n+      # [todo] - Add option to save output to file also\n+      @use_less = false\n+\n+      # Data containers\n+      @ignore_list  = Array.new()\n+      @dir_list     = Array.new()\n+      @file_list    = Array.new()\n+      @tag_list     = Array.new()\n+      @type_list    = Hash.new()\n+      @issue_count  = 0\n+\n+      @tag_format = \"[TAG] - COMMENT\"\n+\n+      # Remote options\n+      @remote_valid   = false\n+\n+      @github_valid    = false\n+      @github_api      = Hash.new\n+      @github_endpoint = \"\"\n+      @github_repo     = \"\"\n+      @github_issues   = Hash.new()\n+\n+\n+\n+      # Keep API param (and put username there) for OAuth update later\n+      @bitbucket_valid  = false\n+      @bitbucket_api    = \"\"\n+      @bitbucket_pw     = \"\"\n+      @bitbucket_repo   = \"\"\n+      @bitbucket_issues = Hash.new()\n+\n+\n+      @gitlab_valid    = false\n+      @gitlab_api      = \"\"\n+      @gitlab_endpoint = \"\"","path":"lib/watson/config.rb","position":184,"original_position":184,"commit_id":"2eb0906071046d4d8fd63cbfc58ecc18de0378f4","original_commit_id":"2eb0906071046d4d8fd63cbfc58ecc18de0378f4","user":{"login":"houndci","id":6697940,"avatar_url":"https://avatars.githubusercontent.com/u/6697940?","gravatar_id":"38d9cefd9971a05bf447f07c6cd332cc","url":"https://api.github.com/users/houndci","html_url":"https://github.com/houndci","followers_url":"https://api.github.com/users/houndci/followers","following_url":"https://api.github.com/users/houndci/following{/other_user}","gists_url":"https://api.github.com/users/houndci/gists{/gist_id}","starred_url":"https://api.github.com/users/houndci/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/houndci/subscriptions","organizations_url":"https://api.github.com/users/houndci/orgs","repos_url":"https://api.github.com/users/houndci/repos","events_url":"https://api.github.com/users/houndci/events{/privacy}","received_events_url":"https://api.github.com/users/houndci/received_events","type":"User","site_admin":false},"body":"Prefer single-quoted strings when you don't need string interpolation or special symbols.","created_at":"2014-04-09T18:55:24Z","updated_at":"2014-04-09T18:55:24Z","html_url":"https://github.com/strudelfish/watson/pull/1#discussion_r11452539","pull_request_url":"https://api.github.com/repos/strudelfish/watson/pulls/1","_links":{"self":{"href":"https://api.github.com/repos/strudelfish/watson/pulls/comments/11452539"},"html":{"href":"https://github.com/strudelfish/watson/pull/1#discussion_r11452539"},"pull_request":{"href":"https://api.github.com/repos/strudelfish/watson/pulls/1"}}}}