Skip to content

Commit

Permalink
style(rubocop): frozen string literals everywhere
Browse files Browse the repository at this point in the history
  • Loading branch information
flavorjones committed Oct 26, 2021
1 parent 6dcb357 commit 49073d3
Show file tree
Hide file tree
Showing 79 changed files with 141 additions and 7 deletions.
7 changes: 0 additions & 7 deletions .rubocop_todo.yml
Original file line number Diff line number Diff line change
Expand Up @@ -379,13 +379,6 @@ Style/EachWithObject:
Exclude:
- 'lib/nokogiri/xml/document.rb'

# Offense count: 78
# Cop supports --auto-correct.
# Configuration parameters: EnforcedStyle.
# SupportedStyles: always, always_true, never
Style/FrozenStringLiteralComment:
Enabled: false

# Offense count: 2
Style/MissingRespondToMissing:
Exclude:
Expand Down
2 changes: 2 additions & 0 deletions Gemfile
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
# frozen_string_literal: true

source "https://rubygems.org"

gemspec
2 changes: 2 additions & 0 deletions Vagrantfile
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
# frozen_string_literal: true

# -*- mode: ruby -*-
# vi: set ft=ruby :

Expand Down
2 changes: 2 additions & 0 deletions rakelib/clean.rake
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
# frozen_string_literal: true

require "rake/clean"
CLEAN.add(
"coverage",
Expand Down
2 changes: 2 additions & 0 deletions rakelib/css-generate.rake
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
# frozen_string_literal: true

namespace "css" do
PARSER_DEPS = { "lib/nokogiri/css/parser.rb" => "lib/nokogiri/css/parser.y" }
TOKENIZER_DEPS = { "lib/nokogiri/css/tokenizer.rb" => "lib/nokogiri/css/tokenizer.rex" }
Expand Down
2 changes: 2 additions & 0 deletions rakelib/debug.rake
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
# frozen_string_literal: true

desc "Set environment variables to build and/or test with debug options"
task :debug do
ENV["NOKOGIRI_DEBUG"] = "true"
Expand Down
2 changes: 2 additions & 0 deletions rakelib/docker.rake
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
# frozen_string_literal: true

#
# docker docker docker
#
Expand Down
2 changes: 2 additions & 0 deletions rakelib/extensions.rake
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
# frozen_string_literal: true

require "rbconfig"
require "shellwords"

Expand Down
2 changes: 2 additions & 0 deletions rakelib/gumbo.rake
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
# frozen_string_literal: true

namespace "gumbo" do
gtest_pkg = "gumbo-parser/googletest"
gtest_lib = File.join(gtest_pkg, "make/gtest_main.a")
Expand Down
2 changes: 2 additions & 0 deletions rakelib/markdown.rake
Original file line number Diff line number Diff line change
@@ -1,2 +1,4 @@
# frozen_string_literal: true

require "hoe/markdown"
Hoe::Markdown::Standalone.new("nokogiri").define_markdown_tasks("CHANGELOG.md", "CONTRIBUTING.md")
2 changes: 2 additions & 0 deletions rakelib/package.rake
Original file line number Diff line number Diff line change
@@ -1,2 +1,4 @@
# frozen_string_literal: true

require "rubygems/package_task"
Gem::PackageTask.new(NOKOGIRI_SPEC).define
2 changes: 2 additions & 0 deletions rakelib/rubocop.rake
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
# frozen_string_literal: true

require "rubocop/rake_task"

module RubocopHelper
Expand Down
2 changes: 2 additions & 0 deletions rakelib/test.rake
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
# frozen_string_literal: true

require "rake/testtask"

#
Expand Down
2 changes: 2 additions & 0 deletions scripts/files-modified-by-open-prs
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
#! /usr/bin/env ruby
# frozen_string_literal: true

#
# script to see what PRs, if any, are operating on a file that I care about.
# yes, this is a smell. we shouldn't have long-lived PRs, but alas here we are.
Expand Down
1 change: 1 addition & 0 deletions scripts/generate-html5-entities
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
#!/usr/bin/env ruby
# frozen_string_literal: true

# Copyright 2018 Stephen Checkoway
#
Expand Down
2 changes: 2 additions & 0 deletions scripts/test-exported-symbols
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
#! /usr/bin/env ruby
# frozen_string_literal: true

#
# examine the nokogiri dll for external symbols that shouldn't be there
#
Expand Down
2 changes: 2 additions & 0 deletions test/css/test_css_integration.rb
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
# frozen_string_literal: true

require "helper"

module Nokogiri
Expand Down
1 change: 1 addition & 0 deletions test/css/test_tokenizer.rb
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
# -*- coding: utf-8 -*-
# frozen_string_literal: true

require "helper"

Expand Down
2 changes: 2 additions & 0 deletions test/decorators/test_slop.rb
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
# frozen_string_literal: true

require "helper"

module Nokogiri
Expand Down
1 change: 1 addition & 0 deletions test/html4/sax/test_parser.rb
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
# -*- coding: utf-8 -*-
# frozen_string_literal: true

require "helper"

Expand Down
1 change: 1 addition & 0 deletions test/html4/sax/test_parser_context.rb
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
# -*- coding: utf-8 -*-
# frozen_string_literal: true

require "helper"

Expand Down
1 change: 1 addition & 0 deletions test/html4/sax/test_parser_text.rb
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
# -*- coding: utf-8 -*-
# frozen_string_literal: true

require "helper"

Expand Down
2 changes: 2 additions & 0 deletions test/html4/test_attributes.rb
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
# frozen_string_literal: true

require "helper"

module Nokogiri
Expand Down
2 changes: 2 additions & 0 deletions test/html4/test_attributes_properly_escaped.rb
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
# frozen_string_literal: true

require "helper"

module Nokogiri
Expand Down
2 changes: 2 additions & 0 deletions test/html4/test_builder.rb
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
# frozen_string_literal: true

require "helper"

module Nokogiri
Expand Down
2 changes: 2 additions & 0 deletions test/html4/test_comments.rb
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
# frozen_string_literal: true

require "helper"

module Nokogiri
Expand Down
2 changes: 2 additions & 0 deletions test/html4/test_element_description.rb
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
# frozen_string_literal: true

require "helper"

module Nokogiri
Expand Down
2 changes: 2 additions & 0 deletions test/html4/test_named_characters.rb
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
# frozen_string_literal: true

require "helper"

module Nokogiri
Expand Down
2 changes: 2 additions & 0 deletions test/html4/test_node.rb
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
# frozen_string_literal: true

require "helper"

require "nkf"
Expand Down
1 change: 1 addition & 0 deletions test/html4/test_node_encoding.rb
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
# -*- coding: utf-8 -*-
# frozen_string_literal: true

require "helper"

Expand Down
1 change: 1 addition & 0 deletions test/html5/test_monkey_patch.rb
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
# encoding: utf-8
# frozen_string_literal: true

require "helper"

Expand Down
2 changes: 2 additions & 0 deletions test/namespaces/test_additional_namespaces_in_builder_doc.rb
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
# frozen_string_literal: true

require "helper"

module Nokogiri
Expand Down
2 changes: 2 additions & 0 deletions test/namespaces/test_namespaces_aliased_default.rb
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
# frozen_string_literal: true

require "helper"

module Nokogiri
Expand Down
2 changes: 2 additions & 0 deletions test/namespaces/test_namespaces_in_builder_doc.rb
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
# frozen_string_literal: true

require "helper"

module Nokogiri
Expand Down
2 changes: 2 additions & 0 deletions test/namespaces/test_namespaces_in_cloned_doc.rb
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
# frozen_string_literal: true

require "helper"

module Nokogiri
Expand Down
2 changes: 2 additions & 0 deletions test/namespaces/test_namespaces_in_created_doc.rb
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
# frozen_string_literal: true

require "helper"

module Nokogiri
Expand Down
2 changes: 2 additions & 0 deletions test/namespaces/test_namespaces_in_parsed_doc.rb
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
# frozen_string_literal: true

require "helper"

module Nokogiri
Expand Down
2 changes: 2 additions & 0 deletions test/namespaces/test_namespaces_preservation.rb
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
# frozen_string_literal: true

require "helper"

module Nokogiri
Expand Down
2 changes: 2 additions & 0 deletions test/test_convert_xpath.rb
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
# frozen_string_literal: true

require "helper"

class TestConvertXPath < Nokogiri::TestCase
Expand Down
2 changes: 2 additions & 0 deletions test/test_css_cache.rb
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
# frozen_string_literal: true

require "helper"

class TestCssCacheAccess < Nokogiri::TestCase
Expand Down
1 change: 1 addition & 0 deletions test/test_encoding_handler.rb
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
# -*- coding: utf-8 -*-
# frozen_string_literal: true

require "helper"

Expand Down
2 changes: 2 additions & 0 deletions test/test_gem_platform.rb
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
# frozen_string_literal: true

require "helper"

class TestGemPlatform < Nokogiri::TestCase
Expand Down
2 changes: 2 additions & 0 deletions test/test_iso.rb
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
# frozen_string_literal: true

require "helper"

class TestISO < Nokogiri::TestCase
Expand Down
2 changes: 2 additions & 0 deletions test/test_memory_leak.rb
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
# frozen_string_literal: true

require "helper"

class TestMemoryLeak < Nokogiri::TestCase
Expand Down
2 changes: 2 additions & 0 deletions test/test_nokogumbo_contract.rb
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
# frozen_string_literal: true

require "helper"

describe "Nokogumbo contract expectations" do
Expand Down
2 changes: 2 additions & 0 deletions test/test_soap4r_sax.rb
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
# frozen_string_literal: true

require "helper"

module XSD
Expand Down
2 changes: 2 additions & 0 deletions test/xml/node/test_attribute_methods.rb
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
# frozen_string_literal: true

require "helper"

class Nokogiri::XML::Node
Expand Down
2 changes: 2 additions & 0 deletions test/xml/node/test_save_options.rb
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
# frozen_string_literal: true

require "helper"

module Nokogiri
Expand Down
2 changes: 2 additions & 0 deletions test/xml/node/test_subclass.rb
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
# frozen_string_literal: true

require "helper"

module Nokogiri
Expand Down
2 changes: 2 additions & 0 deletions test/xml/sax/test_document_error.rb
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
# frozen_string_literal: true

require "helper"

module Nokogiri
Expand Down
1 change: 1 addition & 0 deletions test/xml/sax/test_parser_context.rb
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
# -*- coding: utf-8 -*-
# frozen_string_literal: true

require "helper"

Expand Down
1 change: 1 addition & 0 deletions test/xml/sax/test_parser_text.rb
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
# -*- coding: utf-8 -*-
# frozen_string_literal: true

require "helper"

Expand Down
2 changes: 2 additions & 0 deletions test/xml/test_attr.rb
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
# frozen_string_literal: true

require "helper"

module Nokogiri
Expand Down
2 changes: 2 additions & 0 deletions test/xml/test_attribute_decl.rb
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
# frozen_string_literal: true

require "helper"

module Nokogiri
Expand Down
1 change: 1 addition & 0 deletions test/xml/test_builder.rb
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
# -*- coding: utf-8 -*-
# frozen_string_literal: true

require "helper"

Expand Down
2 changes: 2 additions & 0 deletions test/xml/test_c14n.rb
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
# frozen_string_literal: true

require "helper"

module Nokogiri
Expand Down
2 changes: 2 additions & 0 deletions test/xml/test_cdata.rb
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
# frozen_string_literal: true

require "helper"

module Nokogiri
Expand Down
2 changes: 2 additions & 0 deletions test/xml/test_comment.rb
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
# frozen_string_literal: true

require "helper"

module Nokogiri
Expand Down
2 changes: 2 additions & 0 deletions test/xml/test_document_encoding.rb
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
# frozen_string_literal: true

require "helper"

module Nokogiri
Expand Down
2 changes: 2 additions & 0 deletions test/xml/test_dtd.rb
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
# frozen_string_literal: true

require "helper"

module Nokogiri
Expand Down
1 change: 1 addition & 0 deletions test/xml/test_dtd_encoding.rb
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
# -*- coding: utf-8 -*-
# frozen_string_literal: true

require "helper"

Expand Down
2 changes: 2 additions & 0 deletions test/xml/test_element_content.rb
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
# frozen_string_literal: true

require "helper"

module Nokogiri
Expand Down
2 changes: 2 additions & 0 deletions test/xml/test_element_decl.rb
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
# frozen_string_literal: true

require "helper"

module Nokogiri
Expand Down
2 changes: 2 additions & 0 deletions test/xml/test_entity_decl.rb
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
# frozen_string_literal: true

require "helper"

module Nokogiri
Expand Down
2 changes: 2 additions & 0 deletions test/xml/test_entity_reference.rb
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
# frozen_string_literal: true

require "helper"

module Nokogiri
Expand Down
Loading

0 comments on commit 49073d3

Please sign in to comment.