{"action":"created","comment":{"url":"https://api.github.com/repos/fastlane/fastlane/pulls/comments/49138825","id":49138825,"diff_hunk":"@@ -0,0 +1,89 @@\n+module Fastlane\n+  module Actions\n+\n+    class ClocAction < Action\n+      def self.run(params)\n+        cloc_binary = params[:binary_path]\n+        exclude_dirs = params[:exclude_dir].nil? ? '' : \"--exclude-dir=#{params[:exclude_dir]}\"\n+        xml_format = params[:xml]\n+        out_dir = params[:output_directory]\n+        output_file = xml_format ? \"#{out_dir}/cloc.xml\" : \"#{out_dir}/cloc.txt\"\n+        source_directory = params[:source_directory]\n+\n+        command = [\n+          cloc_binary,\n+          exclude_dirs,\n+          '--by-file',\n+          xml_format ? '--xml ' : '',\n+          \"--out=#{output_file}\",\n+          source_directory\n+        ].join(' ').strip\n+\n+        Actions.sh command\n+      end\n+\n+      #####################################################\n+      # @!group Documentation\n+      #####################################################\n+\n+      def self.description\n+        \"Generates a Code Count that can be read by Jenkins (xml format)\"\n+      end\n+\n+      def self.details\n+        \"This action will run cloc to generate a SLOC report that the Jenkins SLOCCount plugin can read.  See https://wiki.jenkins-ci.org/display/JENKINS/SLOCCount+Plugin for more information.\"\n+      end\n+\n+      def self.available_options\n+        # Define all options your action supports.\n+\n+        # Below a few examples\n+        [\n+          FastlaneCore::ConfigItem.new(key: :binary_path,\n+                                       env_name: \"FL_CLOC_BINARY_PATH\",\n+                                       description: \"Where the cloc binary lives on your system (full path including 'cloc')\",\n+                                       optional: true,\n+                                       is_string: true,\n+                                       default_value: '/usr/local/bin/cloc'),\n+          FastlaneCore::ConfigItem.new(key: :exclude_dir,\n+                                       env_name: \"FL_CLOC_EXCLUDE_DIR\",\n+                                       description: \"Comma separated list of directories to exclude\", # a short description of this parameter\n+                                       optional: true,\n+                                       is_string: true),\n+          FastlaneCore::ConfigItem.new(key: :output_directory,\n+                                       env_name: \"FL_CLOC_OUTPUT_DIRECTORY\",\n+                                       description: \"Where to put the generated report file\",\n+                                       is_string: true,\n+                                       default_value: \"build\"),\n+          FastlaneCore::ConfigItem.new(key: :source_directory,\n+                                      env_name: \"FL_CLOC_SOURCE_DIRECTORY\",\n+                                      description: \"Where to look for the source code (relative to the project root folder)\",\n+                                      is_string: true,\n+                                      default_value: \"\"),\n+          FastlaneCore::ConfigItem.new(key: :xml,\n+                                      env_name: \"FL_CLOC_XML\",\n+                                      description: \"Should we generate an XML File (if false, it will generate a plain text file)?\",\n+                                      is_string: false,\n+                                      default_value: true),\n+        ]\n+      end\n+\n+      def self.output\n+","path":"lib/fastlane/actions/cloc.rb","position":72,"original_position":72,"commit_id":"8adb7d112536cc69b5f6147bc518002da6aa5fdf","original_commit_id":"8adb7d112536cc69b5f6147bc518002da6aa5fdf","user":{"login":"houndci","id":6697940,"avatar_url":"https://avatars.githubusercontent.com/u/6697940?v=3","gravatar_id":"","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":"Extra empty line detected at method body beginning.","created_at":"2016-01-07T23:01:03Z","updated_at":"2016-01-07T23:01:03Z","html_url":"https://github.com/fastlane/fastlane/pull/1070#discussion_r49138825","pull_request_url":"https://api.github.com/repos/fastlane/fastlane/pulls/1070","_links":{"self":{"href":"https://api.github.com/repos/fastlane/fastlane/pulls/comments/49138825"},"html":{"href":"https://github.com/fastlane/fastlane/pull/1070#discussion_r49138825"},"pull_request":{"href":"https://api.github.com/repos/fastlane/fastlane/pulls/1070"}}},"pull_request":{"url":"https://api.github.com/repos/fastlane/fastlane/pulls/1070","id":55403171,"html_url":"https://github.com/fastlane/fastlane/pull/1070","diff_url":"https://github.com/fastlane/fastlane/pull/1070.diff","patch_url":"https://github.com/fastlane/fastlane/pull/1070.patch","issue_url":"https://api.github.com/repos/fastlane/fastlane/issues/1070","number":1070,"state":"open","locked":false,"title":"CLOC (Line Count Tool) Action","user":{"login":"intere","id":2284832,"avatar_url":"https://avatars.githubusercontent.com/u/2284832?v=3","gravatar_id":"","url":"https://api.github.com/users/intere","html_url":"https://github.com/intere","followers_url":"https://api.github.com/users/intere/followers","following_url":"https://api.github.com/users/intere/following{/other_user}","gists_url":"https://api.github.com/users/intere/gists{/gist_id}","starred_url":"https://api.github.com/users/intere/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/intere/subscriptions","organizations_url":"https://api.github.com/users/intere/orgs","repos_url":"https://api.github.com/users/intere/repos","events_url":"https://api.github.com/users/intere/events{/privacy}","received_events_url":"https://api.github.com/users/intere/received_events","type":"User","site_admin":false},"body":"As part of our CI build process, we perform line counts.  CLOC is a tool that will create line count reports in a format that Jenkins supports.  This action allows you to generate them (with various configurations) and put them where you please.","created_at":"2016-01-07T23:00:57Z","updated_at":"2016-01-07T23:01:03Z","closed_at":null,"merged_at":null,"merge_commit_sha":"cab0f07812bf40372abc5e65727eb6962741dd20","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/fastlane/fastlane/pulls/1070/commits","review_comments_url":"https://api.github.com/repos/fastlane/fastlane/pulls/1070/comments","review_comment_url":"https://api.github.com/repos/fastlane/fastlane/pulls/comments{/number}","comments_url":"https://api.github.com/repos/fastlane/fastlane/issues/1070/comments","statuses_url":"https://api.github.com/repos/fastlane/fastlane/statuses/8adb7d112536cc69b5f6147bc518002da6aa5fdf","head":{"label":"MobileDay:feature-cloc","ref":"feature-cloc","sha":"8adb7d112536cc69b5f6147bc518002da6aa5fdf","user":{"login":"MobileDay","id":1355283,"avatar_url":"https://avatars.githubusercontent.com/u/1355283?v=3","gravatar_id":"","url":"https://api.github.com/users/MobileDay","html_url":"https://github.com/MobileDay","followers_url":"https://api.github.com/users/MobileDay/followers","following_url":"https://api.github.com/users/MobileDay/following{/other_user}","gists_url":"https://api.github.com/users/MobileDay/gists{/gist_id}","starred_url":"https://api.github.com/users/MobileDay/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/MobileDay/subscriptions","organizations_url":"https://api.github.com/users/MobileDay/orgs","repos_url":"https://api.github.com/users/MobileDay/repos","events_url":"https://api.github.com/users/MobileDay/events{/privacy}","received_events_url":"https://api.github.com/users/MobileDay/received_events","type":"Organization","site_admin":false},"repo":{"id":49022083,"name":"fastlane","full_name":"MobileDay/fastlane","owner":{"login":"MobileDay","id":1355283,"avatar_url":"https://avatars.githubusercontent.com/u/1355283?v=3","gravatar_id":"","url":"https://api.github.com/users/MobileDay","html_url":"https://github.com/MobileDay","followers_url":"https://api.github.com/users/MobileDay/followers","following_url":"https://api.github.com/users/MobileDay/following{/other_user}","gists_url":"https://api.github.com/users/MobileDay/gists{/gist_id}","starred_url":"https://api.github.com/users/MobileDay/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/MobileDay/subscriptions","organizations_url":"https://api.github.com/users/MobileDay/orgs","repos_url":"https://api.github.com/users/MobileDay/repos","events_url":"https://api.github.com/users/MobileDay/events{/privacy}","received_events_url":"https://api.github.com/users/MobileDay/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/MobileDay/fastlane","description":"Connect all iOS deployment tools into one streamlined workflow","fork":true,"url":"https://api.github.com/repos/MobileDay/fastlane","forks_url":"https://api.github.com/repos/MobileDay/fastlane/forks","keys_url":"https://api.github.com/repos/MobileDay/fastlane/keys{/key_id}","collaborators_url":"https://api.github.com/repos/MobileDay/fastlane/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/MobileDay/fastlane/teams","hooks_url":"https://api.github.com/repos/MobileDay/fastlane/hooks","issue_events_url":"https://api.github.com/repos/MobileDay/fastlane/issues/events{/number}","events_url":"https://api.github.com/repos/MobileDay/fastlane/events","assignees_url":"https://api.github.com/repos/MobileDay/fastlane/assignees{/user}","branches_url":"https://api.github.com/repos/MobileDay/fastlane/branches{/branch}","tags_url":"https://api.github.com/repos/MobileDay/fastlane/tags","blobs_url":"https://api.github.com/repos/MobileDay/fastlane/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/MobileDay/fastlane/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/MobileDay/fastlane/git/refs{/sha}","trees_url":"https://api.github.com/repos/MobileDay/fastlane/git/trees{/sha}","statuses_url":"https://api.github.com/repos/MobileDay/fastlane/statuses/{sha}","languages_url":"https://api.github.com/repos/MobileDay/fastlane/languages","stargazers_url":"https://api.github.com/repos/MobileDay/fastlane/stargazers","contributors_url":"https://api.github.com/repos/MobileDay/fastlane/contributors","subscribers_url":"https://api.github.com/repos/MobileDay/fastlane/subscribers","subscription_url":"https://api.github.com/repos/MobileDay/fastlane/subscription","commits_url":"https://api.github.com/repos/MobileDay/fastlane/commits{/sha}","git_commits_url":"https://api.github.com/repos/MobileDay/fastlane/git/commits{/sha}","comments_url":"https://api.github.com/repos/MobileDay/fastlane/comments{/number}","issue_comment_url":"https://api.github.com/repos/MobileDay/fastlane/issues/comments{/number}","contents_url":"https://api.github.com/repos/MobileDay/fastlane/contents/{+path}","compare_url":"https://api.github.com/repos/MobileDay/fastlane/compare/{base}...{head}","merges_url":"https://api.github.com/repos/MobileDay/fastlane/merges","archive_url":"https://api.github.com/repos/MobileDay/fastlane/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/MobileDay/fastlane/downloads","issues_url":"https://api.github.com/repos/MobileDay/fastlane/issues{/number}","pulls_url":"https://api.github.com/repos/MobileDay/fastlane/pulls{/number}","milestones_url":"https://api.github.com/repos/MobileDay/fastlane/milestones{/number}","notifications_url":"https://api.github.com/repos/MobileDay/fastlane/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/MobileDay/fastlane/labels{/name}","releases_url":"https://api.github.com/repos/MobileDay/fastlane/releases{/id}","created_at":"2016-01-04T20:44:56Z","updated_at":"2016-01-04T20:44:57Z","pushed_at":"2016-01-07T22:58:19Z","git_url":"git://github.com/MobileDay/fastlane.git","ssh_url":"git@github.com:MobileDay/fastlane.git","clone_url":"https://github.com/MobileDay/fastlane.git","svn_url":"https://github.com/MobileDay/fastlane","homepage":"https://fastlane.tools","size":3464,"stargazers_count":0,"watchers_count":0,"language":"Ruby","has_issues":false,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":0,"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"fastlane:master","ref":"master","sha":"761de6427445ead06bb3404946b293d591d81434","user":{"login":"fastlane","id":11098337,"avatar_url":"https://avatars.githubusercontent.com/u/11098337?v=3","gravatar_id":"","url":"https://api.github.com/users/fastlane","html_url":"https://github.com/fastlane","followers_url":"https://api.github.com/users/fastlane/followers","following_url":"https://api.github.com/users/fastlane/following{/other_user}","gists_url":"https://api.github.com/users/fastlane/gists{/gist_id}","starred_url":"https://api.github.com/users/fastlane/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/fastlane/subscriptions","organizations_url":"https://api.github.com/users/fastlane/orgs","repos_url":"https://api.github.com/users/fastlane/repos","events_url":"https://api.github.com/users/fastlane/events{/privacy}","received_events_url":"https://api.github.com/users/fastlane/received_events","type":"Organization","site_admin":false},"repo":{"id":27442967,"name":"fastlane","full_name":"fastlane/fastlane","owner":{"login":"fastlane","id":11098337,"avatar_url":"https://avatars.githubusercontent.com/u/11098337?v=3","gravatar_id":"","url":"https://api.github.com/users/fastlane","html_url":"https://github.com/fastlane","followers_url":"https://api.github.com/users/fastlane/followers","following_url":"https://api.github.com/users/fastlane/following{/other_user}","gists_url":"https://api.github.com/users/fastlane/gists{/gist_id}","starred_url":"https://api.github.com/users/fastlane/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/fastlane/subscriptions","organizations_url":"https://api.github.com/users/fastlane/orgs","repos_url":"https://api.github.com/users/fastlane/repos","events_url":"https://api.github.com/users/fastlane/events{/privacy}","received_events_url":"https://api.github.com/users/fastlane/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/fastlane/fastlane","description":"Connect all iOS deployment tools into one streamlined workflow","fork":false,"url":"https://api.github.com/repos/fastlane/fastlane","forks_url":"https://api.github.com/repos/fastlane/fastlane/forks","keys_url":"https://api.github.com/repos/fastlane/fastlane/keys{/key_id}","collaborators_url":"https://api.github.com/repos/fastlane/fastlane/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/fastlane/fastlane/teams","hooks_url":"https://api.github.com/repos/fastlane/fastlane/hooks","issue_events_url":"https://api.github.com/repos/fastlane/fastlane/issues/events{/number}","events_url":"https://api.github.com/repos/fastlane/fastlane/events","assignees_url":"https://api.github.com/repos/fastlane/fastlane/assignees{/user}","branches_url":"https://api.github.com/repos/fastlane/fastlane/branches{/branch}","tags_url":"https://api.github.com/repos/fastlane/fastlane/tags","blobs_url":"https://api.github.com/repos/fastlane/fastlane/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/fastlane/fastlane/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/fastlane/fastlane/git/refs{/sha}","trees_url":"https://api.github.com/repos/fastlane/fastlane/git/trees{/sha}","statuses_url":"https://api.github.com/repos/fastlane/fastlane/statuses/{sha}","languages_url":"https://api.github.com/repos/fastlane/fastlane/languages","stargazers_url":"https://api.github.com/repos/fastlane/fastlane/stargazers","contributors_url":"https://api.github.com/repos/fastlane/fastlane/contributors","subscribers_url":"https://api.github.com/repos/fastlane/fastlane/subscribers","subscription_url":"https://api.github.com/repos/fastlane/fastlane/subscription","commits_url":"https://api.github.com/repos/fastlane/fastlane/commits{/sha}","git_commits_url":"https://api.github.com/repos/fastlane/fastlane/git/commits{/sha}","comments_url":"https://api.github.com/repos/fastlane/fastlane/comments{/number}","issue_comment_url":"https://api.github.com/repos/fastlane/fastlane/issues/comments{/number}","contents_url":"https://api.github.com/repos/fastlane/fastlane/contents/{+path}","compare_url":"https://api.github.com/repos/fastlane/fastlane/compare/{base}...{head}","merges_url":"https://api.github.com/repos/fastlane/fastlane/merges","archive_url":"https://api.github.com/repos/fastlane/fastlane/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/fastlane/fastlane/downloads","issues_url":"https://api.github.com/repos/fastlane/fastlane/issues{/number}","pulls_url":"https://api.github.com/repos/fastlane/fastlane/pulls{/number}","milestones_url":"https://api.github.com/repos/fastlane/fastlane/milestones{/number}","notifications_url":"https://api.github.com/repos/fastlane/fastlane/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/fastlane/fastlane/labels{/name}","releases_url":"https://api.github.com/repos/fastlane/fastlane/releases{/id}","created_at":"2014-12-02T17:00:38Z","updated_at":"2016-01-07T22:31:36Z","pushed_at":"2016-01-07T23:00:57Z","git_url":"git://github.com/fastlane/fastlane.git","ssh_url":"git@github.com:fastlane/fastlane.git","clone_url":"https://github.com/fastlane/fastlane.git","svn_url":"https://github.com/fastlane/fastlane","homepage":"https://fastlane.tools","size":5856,"stargazers_count":5020,"watchers_count":5020,"language":"Ruby","has_issues":true,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":540,"mirror_url":null,"open_issues_count":186,"forks":540,"open_issues":186,"watchers":5020,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/fastlane/fastlane/pulls/1070"},"html":{"href":"https://github.com/fastlane/fastlane/pull/1070"},"issue":{"href":"https://api.github.com/repos/fastlane/fastlane/issues/1070"},"comments":{"href":"https://api.github.com/repos/fastlane/fastlane/issues/1070/comments"},"review_comments":{"href":"https://api.github.com/repos/fastlane/fastlane/pulls/1070/comments"},"review_comment":{"href":"https://api.github.com/repos/fastlane/fastlane/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/fastlane/fastlane/pulls/1070/commits"},"statuses":{"href":"https://api.github.com/repos/fastlane/fastlane/statuses/8adb7d112536cc69b5f6147bc518002da6aa5fdf"}}}}