1
0
зеркало из https://github.com/glebtv/telegram-bot.git synced 2026-09-04 10:15:50 +03:00
* Update rubopcop [WIP]

* Further rubocop fixes

* Fix rubocop-rails cops

* Fix spec

* Disable rubocop suggestions

* Run rubocop in github actions rather than in codeclimate
Этот коммит содержится в:
Max Melentiev
2023-12-30 15:20:27 +00:00
коммит произвёл GitHub
родитель 7bcb0caded
Коммит 57b17f068c
82 изменённых файлов: 303 добавлений и 134 удалений

Просмотреть файл

@@ -1,4 +1,5 @@
#!/usr/bin/env ruby
# frozen_string_literal: true
require 'bundler/setup'
require 'telegram/bot'

Просмотреть файл

@@ -1,4 +1,6 @@
#!/usr/bin/env ruby
# frozen_string_literal: true
#
# Fetch list of methods from Telegram docs.
# Use it to update client.rb.
@@ -6,7 +8,7 @@
require 'net/http'
require 'nokogiri'
DOCS_URL = 'https://core.telegram.org/bots/api'.freeze
DOCS_URL = 'https://core.telegram.org/bots/api'
page_html = Net::HTTP.get(URI(DOCS_URL))
doc = Nokogiri::HTML(page_html)
@@ -18,11 +20,11 @@ headers = doc.css('h3, h4').
map { |g| g.map(&:text) }
# Method starts with lowercase and does not have spaces.
NOT_METHOD_REGEXP = /(\A[^a-z])|\s/
NOT_METHOD_REGEXP = /(\A[^a-z])|\s/.freeze
# Filter method names.
method_list = headers.
map { |g| g.reject { |x| x.match?(NOT_METHOD_REGEXP) } }.
map { |g| g.grep_v(NOT_METHOD_REGEXP) }.
reject(&:empty?)
api_version = doc.text.match(/^(?:Introducing )?(Bot API ([\d\.]+))\.?$/)

Просмотреть файл

@@ -1,6 +1,7 @@
#!/usr/bin/env ruby
# frozen_string_literal: true
root = File.expand_path('../../', __FILE__)
root = File.expand_path('..', __dir__)
hooks_dir = "#{root}/bin/git-hooks"
`ls -1 #{hooks_dir}`.each_line.map(&:strip).each do |file|