From 4ad475da99c65d42c12adb1a32f3bc4b74123c15 Mon Sep 17 00:00:00 2001 From: Tobias Ludwig Maier Date: Fri, 22 Apr 2022 14:39:31 +0200 Subject: [PATCH 1/3] Add rubocop gem --- Gemfile | 3 +++ Gemfile.lock | 20 ++++++++++++++++++++ 2 files changed, 23 insertions(+) diff --git a/Gemfile b/Gemfile index 37807e4..80dbcfd 100644 --- a/Gemfile +++ b/Gemfile @@ -1,3 +1,5 @@ +# frozen_string_literal: true + source 'https://rubygems.org' gemspec @@ -36,5 +38,6 @@ group :development do gem 'iconv', platforms: [:ruby] gem 'racc' gem 'rake' + gem 'rubocop', '~>1.28.1' gem 'yard' end diff --git a/Gemfile.lock b/Gemfile.lock index 619d1f8..20b4d44 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -7,6 +7,7 @@ PATH GEM remote: https://rubygems.org/ specs: + ast (2.4.2) builder (3.2.4) byebug (11.1.3) columnize (0.9.0) @@ -56,21 +57,38 @@ GEM mime-types-data (3.2022.0105) minitest (5.15.0) multi_test (0.1.2) + parallel (1.22.1) + parser (3.1.2.0) + ast (~> 2.4.1) racc (1.6.0) racc (1.6.0-java) + rainbow (3.1.1) rake (13.0.6) rdf (3.2.6) link_header (~> 0.0, >= 0.0.8) rdf-vocab (3.2.1) rdf (~> 3.2, >= 3.2.4) redcarpet (3.5.1) + regexp_parser (2.3.0) rexml (3.2.5) + rubocop (1.28.1) + parallel (~> 1.10) + parser (>= 3.1.0.0) + rainbow (>= 2.2.2, < 4.0) + regexp_parser (>= 1.8, < 3.0) + rexml + rubocop-ast (>= 1.17.0, < 2.0) + ruby-progressbar (~> 1.7) + unicode-display_width (>= 1.4.0, < 3.0) + rubocop-ast (1.17.0) + parser (>= 3.1.1.0) ruby-debug (0.11.0) columnize (>= 0.1) linecache (~> 1.3.1) ruby-debug-base (~> 0.11.0.0) ruby-debug-base (0.11.0-java) ruby-prof (1.4.3) + ruby-progressbar (1.11.0) simplecov (0.21.2) docile (~> 1.1) simplecov-html (~> 0.11) @@ -80,6 +98,7 @@ GEM sys-uname (1.2.2) ffi (~> 1.1) unicode (0.4.4.4) + unicode-display_width (2.1.0) webrick (1.7.0) yard (0.9.27) webrick (~> 1.7.0) @@ -102,6 +121,7 @@ DEPENDENCIES rdf-vocab (~> 3.0) redcarpet rexml (~> 3.2) + rubocop (~> 1.28.1) ruby-debug ruby-prof simplecov From 9e7ed243a63753e84e64f853cf5737f94d63c62d Mon Sep 17 00:00:00 2001 From: Tobias Ludwig Maier Date: Fri, 22 Apr 2022 14:45:25 +0200 Subject: [PATCH 2/3] Add more rubocop gems --- .rubocop.yml | 169 ++++++++++++++++++++++++++++++++++++++++++++++ .rubocop_todo.yml | 0 Gemfile | 2 + Gemfile.lock | 6 ++ 4 files changed, 177 insertions(+) create mode 100644 .rubocop.yml create mode 100644 .rubocop_todo.yml diff --git a/.rubocop.yml b/.rubocop.yml new file mode 100644 index 0000000..895365f --- /dev/null +++ b/.rubocop.yml @@ -0,0 +1,169 @@ +# The behavior of RuboCop can be controlled via the .rubocop.yml +# configuration file. It makes it possible to enable/disable +# certain cops (checks) and to alter their behavior if they accept +# any parameters. The file can be placed either in your home +# directory or in some project directory. +# +# RuboCop will start looking for the configuration file in the directory +# where the inspected file is and continue its way up to the root directory. +# +# See https://docs.rubocop.org/rubocop/configuration + +inherit_from: .rubocop_todo.yml + +require: + - rubocop-minitest + - rubocop-rake + +# Recently added RuboCop cops + +Gemspec/DateAssignment: # new in 1.10 + Enabled: true +Gemspec/RequireMFA: # new in 1.23 + Enabled: true +Layout/LineEndStringConcatenationIndentation: # new in 1.18 + Enabled: true +Layout/SpaceBeforeBrackets: # new in 1.7 + Enabled: true +Lint/AmbiguousAssignment: # new in 1.7 + Enabled: true +Lint/AmbiguousOperatorPrecedence: # new in 1.21 + Enabled: true +Lint/AmbiguousRange: # new in 1.19 + Enabled: true +Lint/DeprecatedConstants: # new in 1.8 + Enabled: true +Lint/DuplicateBranch: # new in 1.3 + Enabled: true +Lint/DuplicateRegexpCharacterClassElement: # new in 1.1 + Enabled: true +Lint/EmptyBlock: # new in 1.1 + Enabled: true +Lint/EmptyClass: # new in 1.3 + Enabled: true +Lint/EmptyInPattern: # new in 1.16 + Enabled: true +Lint/IncompatibleIoSelectWithFiberScheduler: # new in 1.21 + Enabled: true +Lint/LambdaWithoutLiteralBlock: # new in 1.8 + Enabled: true +Lint/NoReturnInBeginEndBlocks: # new in 1.2 + Enabled: true +Lint/NumberedParameterAssignment: # new in 1.9 + Enabled: true +Lint/OrAssignmentToConstant: # new in 1.9 + Enabled: true +Lint/RedundantDirGlobSort: # new in 1.8 + Enabled: true +Lint/RefinementImportMethods: # new in 1.27 + Enabled: true +Lint/RequireRelativeSelfPath: # new in 1.22 + Enabled: true +Lint/SymbolConversion: # new in 1.9 + Enabled: true +Lint/ToEnumArguments: # new in 1.1 + Enabled: true +Lint/TripleQuotes: # new in 1.9 + Enabled: true +Lint/UnexpectedBlockArity: # new in 1.5 + Enabled: true +Lint/UnmodifiedReduceAccumulator: # new in 1.1 + Enabled: true +Lint/UselessRuby2Keywords: # new in 1.23 + Enabled: true +Naming/BlockForwarding: # new in 1.24 + Enabled: true +Security/CompoundHash: # new in 1.28 + Enabled: true +Security/IoMethods: # new in 1.22 + Enabled: true +Style/ArgumentsForwarding: # new in 1.1 + Enabled: true +Style/CollectionCompact: # new in 1.2 + Enabled: true +Style/DocumentDynamicEvalDefinition: # new in 1.1 + Enabled: true +Style/EndlessMethod: # new in 1.8 + Enabled: true +Style/FetchEnvVar: # new in 1.28 + Enabled: true +Style/FileRead: # new in 1.24 + Enabled: true +Style/FileWrite: # new in 1.24 + Enabled: true +Style/HashConversion: # new in 1.10 + Enabled: true +Style/HashExcept: # new in 1.7 + Enabled: true +Style/IfWithBooleanLiteralBranches: # new in 1.9 + Enabled: true +Style/InPatternThen: # new in 1.16 + Enabled: true +Style/MapToHash: # new in 1.24 + Enabled: true +Style/MultilineInPatternThen: # new in 1.16 + Enabled: true +Style/NegatedIfElseCondition: # new in 1.2 + Enabled: true +Style/NestedFileDirname: # new in 1.26 + Enabled: true +Style/NilLambda: # new in 1.3 + Enabled: true +Style/NumberedParameters: # new in 1.22 + Enabled: true +Style/NumberedParametersLimit: # new in 1.22 + Enabled: true +Style/ObjectThen: # new in 1.28 + Enabled: true +Style/OpenStructUse: # new in 1.23 + Enabled: true +Style/QuotedSymbols: # new in 1.16 + Enabled: true +Style/RedundantArgument: # new in 1.4 + Enabled: true +Style/RedundantInitialize: # new in 1.27 + Enabled: true +Style/RedundantSelfAssignmentBranch: # new in 1.19 + Enabled: true +Style/SelectByRegexp: # new in 1.22 + Enabled: true +Style/StringChars: # new in 1.12 + Enabled: true +Style/SwapValues: # new in 1.1 + Enabled: true +Minitest/AssertInDelta: # new in 0.10 + Enabled: true +Minitest/AssertKindOf: # new in 0.10 + Enabled: true +Minitest/AssertOutput: # new in 0.10 + Enabled: true +Minitest/AssertPathExists: # new in 0.10 + Enabled: true +Minitest/AssertPredicate: # new in 0.18 + Enabled: true +Minitest/AssertSilent: # new in 0.10 + Enabled: true +Minitest/AssertWithExpectedArgument: # new in 0.11 + Enabled: true +Minitest/AssertionInLifecycleHook: # new in 0.10 + Enabled: true +Minitest/DuplicateTestRun: # new in 0.19 + Enabled: true +Minitest/LiteralAsActualArgument: # new in 0.10 + Enabled: true +Minitest/MultipleAssertions: # new in 0.10 + Enabled: true +Minitest/RefuteInDelta: # new in 0.10 + Enabled: true +Minitest/RefuteKindOf: # new in 0.10 + Enabled: true +Minitest/RefutePathExists: # new in 0.10 + Enabled: true +Minitest/RefutePredicate: # new in 0.18 + Enabled: true +Minitest/TestMethodName: # new in 0.10 + Enabled: true +Minitest/UnreachableAssertion: # new in 0.14 + Enabled: true +Minitest/UnspecifiedException: # new in 0.10 + Enabled: true diff --git a/.rubocop_todo.yml b/.rubocop_todo.yml new file mode 100644 index 0000000..e69de29 diff --git a/Gemfile b/Gemfile index 80dbcfd..a30b8ed 100644 --- a/Gemfile +++ b/Gemfile @@ -39,5 +39,7 @@ group :development do gem 'racc' gem 'rake' gem 'rubocop', '~>1.28.1' + gem 'rubocop-minitest', '~>0.19.1' + gem 'rubocop-rake', '~>0.6.0' gem 'yard' end diff --git a/Gemfile.lock b/Gemfile.lock index 20b4d44..85513f0 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -82,6 +82,10 @@ GEM unicode-display_width (>= 1.4.0, < 3.0) rubocop-ast (1.17.0) parser (>= 3.1.1.0) + rubocop-minitest (0.19.1) + rubocop (>= 0.90, < 2.0) + rubocop-rake (0.6.0) + rubocop (~> 1.0) ruby-debug (0.11.0) columnize (>= 0.1) linecache (~> 1.3.1) @@ -122,6 +126,8 @@ DEPENDENCIES redcarpet rexml (~> 3.2) rubocop (~> 1.28.1) + rubocop-minitest (~> 0.19.1) + rubocop-rake (~> 0.6.0) ruby-debug ruby-prof simplecov From c1236c48406da370d628ebff1b5fa512db544133 Mon Sep 17 00:00:00 2001 From: Tobias Ludwig Maier Date: Fri, 22 Apr 2022 15:00:14 +0200 Subject: [PATCH 3/3] Add .rubocop_todo.yml and exclude autogenerated files --- .rubocop.yml | 5 + .rubocop_todo.yml | 617 ++++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 622 insertions(+) diff --git a/.rubocop.yml b/.rubocop.yml index 895365f..021c52e 100644 --- a/.rubocop.yml +++ b/.rubocop.yml @@ -15,6 +15,11 @@ require: - rubocop-minitest - rubocop-rake +AllCops: + Exclude: + - lib/bibtex/name_parser.rb # automatically generated by Racc + - lib/bibtex/parser.rb # automatically generated by Racc + # Recently added RuboCop cops Gemspec/DateAssignment: # new in 1.10 diff --git a/.rubocop_todo.yml b/.rubocop_todo.yml index e69de29..1cad8cc 100644 --- a/.rubocop_todo.yml +++ b/.rubocop_todo.yml @@ -0,0 +1,617 @@ +# This configuration was generated by +# `rubocop --auto-gen-config --auto-gen-only-exclude --exclude-limit 2000 --no-auto-gen-timestamp` +# using RuboCop version 1.28.1. +# The point is for the user to remove these configuration records +# one by one as the offenses are removed from the code base. +# Note that changes in the inspected code, or installation of new +# versions of RuboCop, may require this file to be generated again. + +# Offense count: 1 +# This cop supports safe auto-correction (--auto-correct). +# Configuration parameters: Include. +# Include: **/*.gemspec +Gemspec/RequireMFA: + Exclude: + - 'bibtex-ruby.gemspec' + +# Offense count: 1 +# Configuration parameters: Include. +# Include: **/*.gemspec +Gemspec/RequiredRubyVersion: + Exclude: + - 'bibtex-ruby.gemspec' + +# Offense count: 1 +# This cop supports safe auto-correction (--auto-correct). +Layout/EmptyLines: + Exclude: + - 'lib/bibtex/entry.rb' + +# Offense count: 8 +# Configuration parameters: IgnoredMethods. +Lint/AmbiguousBlockAssociation: + Exclude: + - 'features/step_definitions/bibtex_steps.rb' + - 'test/bibtex/test_value.rb' + +# Offense count: 6 +# This cop supports safe auto-correction (--auto-correct). +Lint/AmbiguousOperatorPrecedence: + Exclude: + - 'lib/bibtex/elements.rb' + - 'lib/bibtex/entry.rb' + - 'lib/bibtex/lexer.rb' + - 'lib/bibtex/names.rb' + +# Offense count: 25 +# This cop supports safe auto-correction (--auto-correct). +Lint/AmbiguousRegexpLiteral: + Exclude: + - 'features/step_definitions/bibtex_steps.rb' + - 'features/step_definitions/name_steps.rb' + +# Offense count: 1 +# Configuration parameters: AllowSafeAssignment. +Lint/AssignmentInCondition: + Exclude: + - 'lib/bibtex/entry.rb' + +# Offense count: 3 +# Configuration parameters: AllowedMethods. +# AllowedMethods: enums +Lint/ConstantDefinitionInBlock: + Exclude: + - 'test/bibtex/test_entry.rb' + - 'test/bibtex/test_filters.rb' + - 'test/bibtex/test_names.rb' + +# Offense count: 5 +# Configuration parameters: IgnoreLiteralBranches, IgnoreConstantBranches. +Lint/DuplicateBranch: + Exclude: + - 'lib/bibtex/bibliography.rb' + - 'lib/bibtex/entry/rdf_converter.rb' + - 'lib/bibtex/value.rb' + +# Offense count: 1 +Lint/DuplicateMethods: + Exclude: + - 'lib/bibtex/compatibility.rb' + +# Offense count: 1 +# This cop supports safe auto-correction (--auto-correct). +Lint/ElseLayout: + Exclude: + - 'lib/bibtex/value.rb' + +# Offense count: 9 +Lint/MissingSuper: + Exclude: + - 'lib/bibtex/elements.rb' + - 'lib/bibtex/entry.rb' + - 'lib/bibtex/error.rb' + - 'lib/bibtex/filters.rb' + - 'lib/bibtex/names.rb' + +# Offense count: 1 +Lint/StructNewOverride: + Exclude: + - 'lib/bibtex/names.rb' + +# Offense count: 46 +# Configuration parameters: IgnoredMethods, CountRepeatedAttributes, Max. +Metrics/AbcSize: + Exclude: + - 'lib/bibtex/bibliography.rb' + - 'lib/bibtex/elements.rb' + - 'lib/bibtex/entry.rb' + - 'lib/bibtex/entry/citeproc_converter.rb' + - 'lib/bibtex/entry/rdf_converter.rb' + - 'lib/bibtex/lexer.rb' + - 'lib/bibtex/names.rb' + - 'lib/bibtex/value.rb' + - 'test/bibtex/test_entry.rb' + - 'test/bibtex/test_utilities.rb' + - 'test/test_bibtex.rb' + +# Offense count: 22 +# Configuration parameters: CountComments, Max, CountAsOne, ExcludedMethods, IgnoredMethods. +# IgnoredMethods: refine +Metrics/BlockLength: + Exclude: + - '**/*.gemspec' + - 'test/bibtex/test_bibliography.rb' + - 'test/bibtex/test_entry.rb' + - 'test/bibtex/test_names.rb' + - 'test/bibtex/test_parser.rb' + - 'test/bibtex/test_value.rb' + +# Offense count: 6 +# Configuration parameters: CountBlocks, Max. +Metrics/BlockNesting: + Exclude: + - 'lib/bibtex/elements.rb' + - 'lib/bibtex/entry/citeproc_converter.rb' + - 'lib/bibtex/lexer.rb' + +# Offense count: 14 +# Configuration parameters: CountComments, Max, CountAsOne. +Metrics/ClassLength: + Exclude: + - 'lib/bibtex/bibliography.rb' + - 'lib/bibtex/elements.rb' + - 'lib/bibtex/entry.rb' + - 'lib/bibtex/entry/citeproc_converter.rb' + - 'lib/bibtex/entry/rdf_converter.rb' + - 'lib/bibtex/lexer.rb' + - 'lib/bibtex/names.rb' + - 'lib/bibtex/value.rb' + - 'test/bibtex/entry/test_rdf_converter.rb' + - 'test/bibtex/test_bibliography.rb' + - 'test/bibtex/test_entry.rb' + - 'test/bibtex/test_names.rb' + - 'test/bibtex/test_parser.rb' + - 'test/bibtex/test_value.rb' + +# Offense count: 13 +# Configuration parameters: IgnoredMethods, Max. +Metrics/CyclomaticComplexity: + Exclude: + - 'lib/bibtex/bibliography.rb' + - 'lib/bibtex/elements.rb' + - 'lib/bibtex/entry/citeproc_converter.rb' + - 'lib/bibtex/entry/rdf_converter.rb' + - 'lib/bibtex/lexer.rb' + - 'lib/bibtex/value.rb' + +# Offense count: 24 +# Configuration parameters: CountComments, Max, CountAsOne, ExcludedMethods, IgnoredMethods. +Metrics/MethodLength: + Exclude: + - 'lib/bibtex/bibliography.rb' + - 'lib/bibtex/elements.rb' + - 'lib/bibtex/entry.rb' + - 'lib/bibtex/entry/citeproc_converter.rb' + - 'lib/bibtex/entry/rdf_converter.rb' + - 'lib/bibtex/lexer.rb' + - 'lib/bibtex/value.rb' + - 'test/bibtex/test_entry.rb' + - 'test/test_bibtex.rb' + +# Offense count: 10 +# Configuration parameters: IgnoredMethods, Max. +Metrics/PerceivedComplexity: + Exclude: + - 'lib/bibtex/bibliography.rb' + - 'lib/bibtex/elements.rb' + - 'lib/bibtex/entry/citeproc_converter.rb' + - 'lib/bibtex/entry/rdf_converter.rb' + - 'lib/bibtex/lexer.rb' + - 'lib/bibtex/value.rb' + +# Offense count: 6 +# This cop supports safe auto-correction (--auto-correct). +Minitest/AssertEmpty: + Exclude: + - 'test/bibtex/test_bibliography.rb' + - 'test/bibtex/test_utilities.rb' + - 'test/bibtex/test_value.rb' + - 'test/test_bibtex.rb' + +# Offense count: 4 +# This cop supports safe auto-correction (--auto-correct). +Minitest/AssertEmptyLiteral: + Exclude: + - 'test/bibtex/test_bibliography.rb' + - 'test/bibtex/test_entry.rb' + +# Offense count: 4 +# This cop supports safe auto-correction (--auto-correct). +Minitest/AssertEqual: + Exclude: + - 'test/bibtex/test_bibliography.rb' + - 'test/bibtex/test_value.rb' + +# Offense count: 13 +# This cop supports safe auto-correction (--auto-correct). +Minitest/AssertPredicate: + Exclude: + - 'test/bibtex/test_bibliography.rb' + - 'test/bibtex/test_entry.rb' + - 'test/bibtex/test_utilities.rb' + - 'test/bibtex/test_value.rb' + - 'test/test_bibtex.rb' + +# Offense count: 2 +# This cop supports safe auto-correction (--auto-correct). +Minitest/AssertTruthy: + Exclude: + - 'test/bibtex/test_entry.rb' + +# Offense count: 111 +# This cop supports safe auto-correction (--auto-correct). +# Configuration parameters: EnforcedStyle, Include. +# Include: **/test/**/*, **/*_test.rb, **/spec/**/*, **/*_spec.rb +# SupportedStyles: _, any, expect, value +Minitest/GlobalExpectations: + Exclude: + - 'test/bibtex/test_bibliography.rb' + - 'test/bibtex/test_elements.rb' + - 'test/bibtex/test_entry.rb' + - 'test/bibtex/test_lexer.rb' + - 'test/bibtex/test_names.rb' + - 'test/bibtex/test_parser.rb' + - 'test/bibtex/test_value.rb' + +# Offense count: 5 +# This cop supports safe auto-correction (--auto-correct). +Minitest/LiteralAsActualArgument: + Exclude: + - 'test/bibtex/test_lexer.rb' + - 'test/bibtex/test_name_parser.rb' + +# Offense count: 4 +# Configuration parameters: Max. +Minitest/MultipleAssertions: + Exclude: + - 'test/bibtex/test_entry.rb' + +# Offense count: 2 +# This cop supports safe auto-correction (--auto-correct). +Minitest/RefuteEmpty: + Exclude: + - 'test/bibtex/test_parser.rb' + - 'test/bibtex/test_utilities.rb' + +# Offense count: 6 +# This cop supports safe auto-correction (--auto-correct). +Minitest/RefuteFalse: + Exclude: + - 'test/bibtex/test_entry.rb' + - 'test/bibtex/test_filters.rb' + +# Offense count: 1 +# This cop supports safe auto-correction (--auto-correct). +Minitest/RefuteNil: + Exclude: + - 'test/bibtex/test_string.rb' + +# Offense count: 11 +# This cop supports safe auto-correction (--auto-correct). +Minitest/RefutePredicate: + Exclude: + - 'test/bibtex/test_entry.rb' + - 'test/bibtex/test_parser.rb' + - 'test/bibtex/test_string.rb' + - 'test/bibtex/test_utilities.rb' + - 'test/bibtex/test_value.rb' + +# Offense count: 1 +Naming/ConstantName: + Exclude: + - 'lib/bibtex/names.rb' + +# Offense count: 19 +# Configuration parameters: ForbiddenDelimiters. +# ForbiddenDelimiters: (?-mix:(^|\s)(EO[A-Z]{1}|END)(\s|$)) +Naming/HeredocDelimiterNaming: + Exclude: + - 'test/benchmark.rb' + - 'test/bibtex/test_bibliography.rb' + - 'test/bibtex/test_entry.rb' + - 'test/bibtex/test_parser.rb' + - 'test/macruby.rb' + - 'test/profile.rb' + - 'test/test_bibtex.rb' + +# Offense count: 1 +# Configuration parameters: MinNameLength, AllowNamesEndingInNumbers, AllowedNames, ForbiddenNames. +# AllowedNames: at, by, db, id, in, io, ip, of, on, os, pp, to +Naming/MethodParameterName: + Exclude: + - 'lib/bibtex/elements.rb' + +# Offense count: 5 +# Configuration parameters: NamePrefix, ForbiddenPrefixes, AllowedMethods, MethodDefinitionMacros. +# NamePrefix: is_, has_, have_ +# ForbiddenPrefixes: is_, has_, have_ +# AllowedMethods: is_a? +# MethodDefinitionMacros: define_method, define_singleton_method +Naming/PredicateName: + Exclude: + - 'spec/**/*' + - 'lib/bibtex/elements.rb' + - 'lib/bibtex/entry.rb' + +# Offense count: 1 +# Configuration parameters: EnforcedStyle, CheckMethodNames, CheckSymbols, AllowedIdentifiers. +# SupportedStyles: snake_case, normalcase, non_integer +# AllowedIdentifiers: capture3, iso8601, rfc1123_date, rfc822, rfc2822, rfc3339 +Naming/VariableNumber: + Exclude: + - 'Gemfile' + +# Offense count: 1 +# This cop supports safe auto-correction (--auto-correct). +Rake/Desc: + Exclude: + - 'Rakefile' + +# Offense count: 2 +# This cop supports safe auto-correction (--auto-correct). +Style/BisectedAttrAccessor: + Exclude: + - 'lib/bibtex/lexer.rb' + +# Offense count: 1 +# This cop supports safe auto-correction (--auto-correct). +# Configuration parameters: EnforcedStyle, ProceduralMethods, FunctionalMethods, IgnoredMethods, AllowBracesOnProceduralOneLiners, BracesRequiredMethods. +# SupportedStyles: line_count_based, semantic, braces_for_chaining, always_braces +# ProceduralMethods: benchmark, bm, bmbm, create, each_with_object, measure, new, realtime, tap, with_object +# FunctionalMethods: let, let!, subject, watch +# IgnoredMethods: lambda, proc, it +Style/BlockDelimiters: + Exclude: + - 'lib/bibtex/value.rb' + +# Offense count: 4 +# This cop supports safe auto-correction (--auto-correct). +# Configuration parameters: EnforcedStyle. +# SupportedStyles: nested, compact +Style/ClassAndModuleChildren: + Exclude: + - 'lib/bibtex/bibliography/rdf_converter.rb' + - 'lib/bibtex/entry/bibtexml_converter.rb' + - 'lib/bibtex/entry/citeproc_converter.rb' + - 'lib/bibtex/entry/rdf_converter.rb' + +# Offense count: 1 +# This cop supports safe auto-correction (--auto-correct). +# Configuration parameters: EnforcedStyle, SingleLineConditionsOnly, IncludeTernaryExpressions. +# SupportedStyles: assign_to_condition, assign_inside_condition +Style/ConditionalAssignment: + Exclude: + - 'lib/bibtex/entry/rdf_converter.rb' + +# Offense count: 12 +# Configuration parameters: AllowedConstants. +Style/Documentation: + Exclude: + - 'spec/**/*' + - 'test/**/*' + - 'lib/bibtex/bibliography/rdf_converter.rb' + - 'lib/bibtex/compatibility.rb' + - 'lib/bibtex/entry/bibtexml_converter.rb' + - 'lib/bibtex/entry/citeproc_converter.rb' + - 'lib/bibtex/entry/rdf_converter.rb' + - 'lib/bibtex/error.rb' + - 'lib/bibtex/extensions.rb' + - 'lib/bibtex/filters.rb' + - 'lib/bibtex/filters/latex.rb' + - 'lib/bibtex/filters/linebreaks.rb' + - 'lib/bibtex/utilities.rb' + +# Offense count: 47 +# This cop supports safe auto-correction (--auto-correct). +# Configuration parameters: EnforcedStyle. +# SupportedStyles: always, always_true, never +Style/FrozenStringLiteralComment: + Exclude: + - '.simplecov' + - 'Rakefile' + - 'bibtex-ruby.gemspec' + - 'examples/bib2html.rb' + - 'examples/bib2yaml.rb' + - 'features/step_definitions/bibtex_steps.rb' + - 'features/step_definitions/name_steps.rb' + - 'features/support/env.rb' + - 'lib/bibtex.rb' + - 'lib/bibtex/bibliography.rb' + - 'lib/bibtex/bibliography/rdf_converter.rb' + - 'lib/bibtex/compatibility.rb' + - 'lib/bibtex/elements.rb' + - 'lib/bibtex/entry.rb' + - 'lib/bibtex/entry/bibtexml_converter.rb' + - 'lib/bibtex/entry/citeproc_converter.rb' + - 'lib/bibtex/entry/rdf_converter.rb' + - 'lib/bibtex/error.rb' + - 'lib/bibtex/extensions.rb' + - 'lib/bibtex/filters.rb' + - 'lib/bibtex/filters/latex.rb' + - 'lib/bibtex/filters/linebreaks.rb' + - 'lib/bibtex/lexer.rb' + - 'lib/bibtex/names.rb' + - 'lib/bibtex/replaceable.rb' + - 'lib/bibtex/ruby.rb' + - 'lib/bibtex/utilities.rb' + - 'lib/bibtex/value.rb' + - 'lib/bibtex/version.rb' + - 'test/benchmark.rb' + - 'test/bibtex/entry/test_rdf_converter.rb' + - 'test/bibtex/test_bibliography.rb' + - 'test/bibtex/test_elements.rb' + - 'test/bibtex/test_entry.rb' + - 'test/bibtex/test_filters.rb' + - 'test/bibtex/test_lexer.rb' + - 'test/bibtex/test_name_parser.rb' + - 'test/bibtex/test_names.rb' + - 'test/bibtex/test_parser.rb' + - 'test/bibtex/test_string.rb' + - 'test/bibtex/test_utilities.rb' + - 'test/bibtex/test_value.rb' + - 'test/helper.rb' + - 'test/macruby.rb' + - 'test/profile.rb' + - 'test/test_bibtex.rb' + - 'test/test_export.rb' + +# Offense count: 2 +# This cop supports safe auto-correction (--auto-correct). +Style/GlobalStdStream: + Exclude: + - 'examples/bib2yaml.rb' + - 'lib/bibtex.rb' + +# Offense count: 3 +# Configuration parameters: MinBodyLength, AllowConsecutiveConditionals. +Style/GuardClause: + Exclude: + - 'lib/bibtex/entry/rdf_converter.rb' + - 'lib/bibtex/value.rb' + +# Offense count: 2 +# This cop supports safe auto-correction (--auto-correct). +# Configuration parameters: AllowSplatArgument. +Style/HashConversion: + Exclude: + - 'lib/bibtex/compatibility.rb' + - 'lib/bibtex/names.rb' + +# Offense count: 2 +# This cop supports unsafe auto-correction (--auto-correct-all). +# Configuration parameters: AllowedReceivers. +Style/HashEachMethods: + Exclude: + - 'lib/bibtex/bibliography.rb' + - 'lib/bibtex/entry.rb' + +# Offense count: 1 +# This cop supports safe auto-correction (--auto-correct). +# Configuration parameters: AllowIfModifier. +Style/IfInsideElse: + Exclude: + - 'lib/bibtex/names.rb' + +# Offense count: 5 +# This cop supports safe auto-correction (--auto-correct). +Style/IfUnlessModifier: + Exclude: + - 'lib/bibtex/bibliography.rb' + - 'lib/bibtex/elements.rb' + - 'lib/bibtex/error.rb' + - 'lib/bibtex/lexer.rb' + +# Offense count: 2 +Style/MissingRespondToMissing: + Exclude: + - 'lib/bibtex/entry.rb' + - 'lib/bibtex/value.rb' + +# Offense count: 1 +Style/MixinUsage: + Exclude: + - 'test/benchmark.rb' + +# Offense count: 1 +Style/MultilineBlockChain: + Exclude: + - 'lib/bibtex/bibliography.rb' + +# Offense count: 1 +# This cop supports safe auto-correction (--auto-correct). +Style/MultilineTernaryOperator: + Exclude: + - 'lib/bibtex/bibliography.rb' + +# Offense count: 2 +# This cop supports safe auto-correction (--auto-correct). +Style/NegatedIfElseCondition: + Exclude: + - 'lib/bibtex/entry.rb' + +# Offense count: 1 +# This cop supports safe auto-correction (--auto-correct). +Style/NestedTernaryOperator: + Exclude: + - 'lib/bibtex/entry.rb' + +# Offense count: 4 +# This cop supports unsafe auto-correction (--auto-correct-all). +# Configuration parameters: EnforcedStyle, IgnoredMethods. +# SupportedStyles: predicate, comparison +Style/NumericPredicate: + Exclude: + - 'spec/**/*' + - 'lib/bibtex/lexer.rb' + +# Offense count: 3 +# Configuration parameters: AllowedMethods. +# AllowedMethods: respond_to_missing? +Style/OptionalBooleanParameter: + Exclude: + - 'lib/bibtex/entry.rb' + - 'lib/bibtex/value.rb' + +# Offense count: 3 +# This cop supports safe auto-correction (--auto-correct). +# Configuration parameters: EnforcedStyle. +# SupportedStyles: same_as_string_literals, single_quotes, double_quotes +Style/QuotedSymbols: + Exclude: + - 'test/bibtex/test_parser.rb' + +# Offense count: 10 +# This cop supports safe auto-correction (--auto-correct). +Style/RedundantFileExtensionInRequire: + Exclude: + - 'test/bibtex/entry/test_rdf_converter.rb' + - 'test/bibtex/test_entry.rb' + - 'test/bibtex/test_filters.rb' + - 'test/bibtex/test_lexer.rb' + - 'test/bibtex/test_parser.rb' + - 'test/bibtex/test_string.rb' + - 'test/bibtex/test_utilities.rb' + - 'test/bibtex/test_value.rb' + - 'test/test_bibtex.rb' + - 'test/test_export.rb' + +# Offense count: 1 +# This cop supports safe auto-correction (--auto-correct). +Style/RedundantRegexpCharacterClass: + Exclude: + - 'lib/bibtex/lexer.rb' + +# Offense count: 13 +# This cop supports safe auto-correction (--auto-correct). +Style/RedundantRegexpEscape: + Exclude: + - 'lib/bibtex/lexer.rb' + - 'lib/bibtex/names.rb' + +# Offense count: 2 +# This cop supports safe auto-correction (--auto-correct). +Style/SelectByRegexp: + Exclude: + - 'lib/bibtex/names.rb' + - 'lib/bibtex/value.rb' + +# Offense count: 1 +# This cop supports unsafe auto-correction (--auto-correct-all). +# Configuration parameters: Mode. +Style/StringConcatenation: + Exclude: + - 'test/bibtex/test_bibliography.rb' + +# Offense count: 1 +# This cop supports safe auto-correction (--auto-correct). +Style/StructInheritance: + Exclude: + - 'lib/bibtex/names.rb' + +# Offense count: 26 +# This cop supports safe auto-correction (--auto-correct). +# Configuration parameters: Max, AllowHeredoc, AllowURI, URISchemes, IgnoreCopDirectives, AllowedPatterns, IgnoredPatterns. +# URISchemes: http, https +Layout/LineLength: + Exclude: + - 'features/step_definitions/bibtex_steps.rb' + - 'lib/bibtex/bibliography.rb' + - 'lib/bibtex/elements.rb' + - 'lib/bibtex/error.rb' + - 'lib/bibtex/lexer.rb' + - 'lib/bibtex/value.rb' + - 'test/bibtex/test_bibliography.rb' + - 'test/bibtex/test_entry.rb' + - 'test/bibtex/test_lexer.rb' + - 'test/bibtex/test_names.rb' + - 'test/bibtex/test_utilities.rb'