Move documentation-related rules into its own group

This commit is contained in:
Sijawusz Pur Rahnama 2023-11-08 18:31:12 +01:00
parent 0c6745781e
commit 8569355b5a
7 changed files with 12 additions and 10 deletions

View file

@ -1,4 +1,4 @@
Lint/DocumentationAdmonition: Documentation/DocumentationAdmonition:
Timezone: UTC Timezone: UTC
Admonitions: [FIXME, BUG] Admonitions: [FIXME, BUG]

View file

@ -12,6 +12,7 @@ module Ameba::Rule
it "contains rules across all the available groups" do it "contains rules across all the available groups" do
Rule.rules.map(&.group_name).uniq!.reject!(&.empty?).sort.should eq %w( Rule.rules.map(&.group_name).uniq!.reject!(&.empty?).sort.should eq %w(
Ameba Ameba
Documentation
Layout Layout
Lint Lint
Metrics Metrics

View file

@ -1,6 +1,6 @@
require "../../../spec_helper" require "../../../spec_helper"
module Ameba::Rule::Lint module Ameba::Rule::Documentation
subject = DocumentationAdmonition.new subject = DocumentationAdmonition.new
describe DocumentationAdmonition do describe DocumentationAdmonition do

View file

@ -1,6 +1,6 @@
require "../../../spec_helper" require "../../../spec_helper"
module Ameba::Rule::Lint module Ameba::Rule::Documentation
subject = Documentation.new subject = Documentation.new
.tap(&.ignore_classes = false) .tap(&.ignore_classes = false)
.tap(&.ignore_modules = false) .tap(&.ignore_modules = false)

View file

@ -326,9 +326,10 @@ class Ameba::Config
macro included macro included
GROUP_SEVERITY = { GROUP_SEVERITY = {
Lint: Ameba::Severity::Warning, Documentation: Ameba::Severity::Warning,
Metrics: Ameba::Severity::Warning, Lint: Ameba::Severity::Warning,
Performance: Ameba::Severity::Warning, Metrics: Ameba::Severity::Warning,
Performance: Ameba::Severity::Warning,
} }
class_getter default_severity : Ameba::Severity do class_getter default_severity : Ameba::Severity do

View file

@ -1,11 +1,11 @@
module Ameba::Rule::Lint module Ameba::Rule::Documentation
# A rule that enforces documentation for public types: # A rule that enforces documentation for public types:
# modules, classes, enums, methods and macros. # modules, classes, enums, methods and macros.
# #
# YAML configuration example: # YAML configuration example:
# #
# ``` # ```
# Lint/Documentation: # Documentation/Documentation:
# Enabled: true # Enabled: true
# IgnoreClasses: false # IgnoreClasses: false
# IgnoreModules: true # IgnoreModules: true

View file

@ -1,4 +1,4 @@
module Ameba::Rule::Lint module Ameba::Rule::Documentation
# A rule that reports documentation admonitions. # A rule that reports documentation admonitions.
# #
# Optionally, these can fail at an appropriate time. # Optionally, these can fail at an appropriate time.
@ -27,7 +27,7 @@ module Ameba::Rule::Lint
# YAML configuration example: # YAML configuration example:
# #
# ``` # ```
# Lint/DocumentationAdmonition: # Documentation/DocumentationAdmonition:
# Enabled: true # Enabled: true
# Admonitions: [TODO, FIXME, BUG] # Admonitions: [TODO, FIXME, BUG]
# Timezone: UTC # Timezone: UTC