<commit_before>
require "trollop"

require_relative "base"

module GerritHooks

    class PatchsetCreated < Base

        def initialize
            super
        end

        def parse_args args = ARGV

            p = Trollop::Parser.new do
                opt :change, "Change id", type: :string, required: true
                opt :is_draft, "Whether the change is a draft", type: :string, default: "false", required: false
                opt :change_url, "URL to the change", type: :string, required: true
                opt :project, "Project of the change", type: :string, required: true
                opt :branch, "Branch of the project for the change", type: :string, required: true
                opt :topic, "Optional topic for the change", type: :string, required: false
                opt :uploader, "Uploader of the change", type: :string, required: true
                opt :commit, "Commit id of the change", type: :string, required: true
                opt :patchset, "Patch set id of the change", type: :string, required: true
            end

            opts = Trollop::with_standard_exception_handling p do
                raise Trollop::HelpNeeded if args.empty?
                p.parse args
            end

            if opts[:is_draft] == "true" then @is_draft = true else @is_draft = false end

            @change_id = opts[:change]
            @change_url = opts[:change_url]
            @project_name = opts[:project]
            @branch_name = opts[:branch]
            @topic_name = opts[:topic]
            @uploader_name = opts[:uploader]
            @commit_id = opts[:commit]
            @patchset_id = opts[:patchset]

            @identifier = @change_url.split("/")[-1]
            @short_identifier = @identifier[-2, 2]
<commit_msg>use correct vars for change_id<commit_after>
require "trollop"

require_relative "base"

module GerritHooks

    class PatchsetCreated < Base

        def initialize
            super
        end

        def parse_args args = ARGV

            p = Trollop::Parser.new do
                opt :change, "Change id, like Id0eec3a5198489bf35ef016dba39961f8675a77c", type: :string, required: true
                opt :is_draft, "Whether the change is a draft", type: :string, default: "false", required: false
                opt :change_url, "URL to the change", type: :string, required: true
                opt :project, "Project of the change", type: :string, required: true
                opt :branch, "Branch of the project for the change", type: :string, required: true
                opt :topic, "Optional topic for the change", type: :string, required: false
                opt :uploader, "Uploader of the change", type: :string, required: true
                opt :commit, "Commit id of the change", type: :string, required: true
                opt :patchset, "Patch set id of the change", type: :string, required: true
            end

            opts = Trollop::with_standard_exception_handling p do
                raise Trollop::HelpNeeded if args.empty?
                p.parse args
            end

            if opts[:is_draft] == "true" then @is_draft = true else @is_draft = false end

            @git_change_id = opts[:change]
            @change_url = opts[:change_url]
            @project_name = opts[:project]
            @branch_name = opts[:branch]
            @topic_name = opts[:topic]
            @uploader_name = opts[:uploader]
            @commit_id = opts[:commit]
            @patchset_id = opts[:patchset]

            @identifier = @change_url.split("/")[-1]
            @change_id = @identifier
            @short_identifier = @identifier[-2, 2]

{'fraction_non_alphanumeric': 0.09716157205240175, 'fraction_numerical': 0.008460698689956333, 'mean_word_length': 2.0339403973509933, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '479072', 'n_tokens_mistral': 1038, 'n_tokens_neox': 978, 'n_words': 334}