From 0dc79728f034574cd4cdd1fed7f2f61eb19757c7 Mon Sep 17 00:00:00 2001 From: Datpmt Date: Thu, 5 Dec 2024 15:22:30 +0700 Subject: [PATCH] test rb --- test/example.py | 1 + typocop.rb | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/test/example.py b/test/example.py index 156dc29e..b66c86e1 100644 --- a/test/example.py +++ b/test/example.py @@ -23,5 +23,6 @@ def factorial(n): if age >= 18: print("You are elligible for an adult privilege.") # typo print("You are elligible for an adult privilege.") # typo + print("You are elligible for an adult privilege.") # typo else: print("You are underage, so no adult privileges for you.") diff --git a/typocop.rb b/typocop.rb index 569c698e..86280a18 100644 --- a/typocop.rb +++ b/typocop.rb @@ -68,7 +68,7 @@ def initialize(path, line, incorrect_word, correct_word) puts "body: #{body}" repo_remote_url = repo.remotes.first.url - match = %r{(?:https?://)?(?:www\.)?github\.com[/:](?[^/]+/[^/]+)(?:\.git)?\z}.match(repo_remote_url) + match = %r{(?:https?://)?(?:www\.)?github\.com[/:](?.*?)(?:\.git)?\z}.match(repo_remote_url) repo_name = match[:repo_name] create_comment(client, repo_name, body, repo.head.target_id, typo.path, typo.line) end