Last active
November 10, 2021 14:47
-
-
Save Synkevych/1b7c386bc4c4dedf09571beee7ca54b7 to your computer and use it in GitHub Desktop.
Revisions
-
Synkevych revised this gist
Nov 10, 2021 . 1 changed file with 2 additions and 2 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -1,5 +1,5 @@ #!/usr/bin/env ruby require 'English' require 'rubocop' @@ -13,7 +13,7 @@ changed_files = `git status --porcelain`.split(/\n/). file_name_with_status.split(' ')[1] }. select { |file_name| File.extname(file_name) == '.rb' unless file_name == 'db/schema.rb' }.join(' ') system("rubocop #{changed_files}") unless changed_files.empty? -
Synkevych revised this gist
Jan 30, 2021 . No changes.There are no files selected for viewing
-
Synkevych created this gist
Jan 13, 2021 .There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,21 @@ #!/usr/bin/env ruby require 'English' require 'rubocop' ADDED_OR_MODIFIED = /A|AM|^M/.freeze changed_files = `git status --porcelain`.split(/\n/). select { |file_name_with_status| file_name_with_status =~ ADDED_OR_MODIFIED }. map { |file_name_with_status| file_name_with_status.split(' ')[1] }. select { |file_name| File.extname(file_name) == '.rb' }.join(' ') system("rubocop #{changed_files}") unless changed_files.empty? exit $CHILD_STATUS.to_s[-1].to_i