Merge pull request #412 from crystal-ameba/group-documentation-rules

Move documentation-related rules into its own group
This commit is contained in:
Sijawusz Pur Rahnama 2023-11-09 06:19:36 +01:00 committed by GitHub
commit 881209d54e
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
7 changed files with 12 additions and 10 deletions

View File

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

View File

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

View File

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

View File

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

View File

@ -326,9 +326,10 @@ class Ameba::Config
macro included
GROUP_SEVERITY = {
Lint: Ameba::Severity::Warning,
Metrics: Ameba::Severity::Warning,
Performance: Ameba::Severity::Warning,
Documentation: Ameba::Severity::Warning,
Lint: Ameba::Severity::Warning,
Metrics: Ameba::Severity::Warning,
Performance: Ameba::Severity::Warning,
}
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:
# modules, classes, enums, methods and macros.
#
# YAML configuration example:
#
# ```
# Lint/Documentation:
# Documentation/Documentation:
# Enabled: true
# IgnoreClasses: false
# IgnoreModules: true

View File

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