Linter 1.2 => 1.3 (#7794)

Co-authored-by: chronos <no-reply@github.com>
This commit is contained in:
Ed Reel
2023-01-02 21:23:12 -06:00
committed by GitHub
parent 83672c9095
commit f04630f3b9
5 changed files with 36 additions and 9 deletions

11
.github/workflows/.mdl_style.rb vendored Normal file
View File

@@ -0,0 +1,11 @@
all
# Ignore 80 character line length limit.
exclude_rule 'MD013'
# Ignore horizontal rule style.
exclude_rule 'MD035'
# Ignore emphasis used instead of a header.
exclude_rule 'MD036'
# Ignore first line in file should be a top level header.
exclude_rule 'MD041'
# Ignore code block style.
exclude_rule 'MD046'

1
.github/workflows/.mdlrc vendored Normal file
View File

@@ -0,0 +1 @@
style '.mdl_style.rb'

View File

@@ -42,7 +42,7 @@ jobs:
fi
case $ext in
md)
mdl "$file"
mdl -c .mdlrc "$file"
;;
rb)
ruby=true

View File

@@ -1,5 +0,0 @@
all
exclude_rule 'MD035'
exclude_rule 'MD036'
exclude_rule 'MD041'
exclude_rule 'MD046'

View File

@@ -3,7 +3,7 @@ require 'package'
class Linter < Package
description 'Comprehensive linter and code analysis for various file types.'
homepage 'https://github.com/chromebrew/chromebrew'
version '1.2'
version '1.3'
license 'GPL-3'
compatibility 'all'
source_url 'SKIP'
@@ -43,7 +43,7 @@ class Linter < Package
fi
case $ext in
md)
mdl "$file"
mdl -c $HOME/.mdlrc "$file"
;;
rb)
ruby=true
@@ -63,10 +63,30 @@ class Linter < Package
done
EOF
File.write('linter', linter)
mdlrc = <<~EOF
style "#{Dir.home}/.mdl_style.rb"
EOF
File.write('.mdlrc', mdlrc)
mdl_style = <<~EOF
all
# Ignore 80 character line length limit.
exclude_rule 'MD013'
# Ignore horizontal rule style.
exclude_rule 'MD035'
# Ignore emphasis used instead of a header.
exclude_rule 'MD036'
# Ignore first line in file should be a top level header.
exclude_rule 'MD041'
# Ignore code block style.
exclude_rule 'MD046'
EOF
File.write('.mdl_style.rb', mdl_style)
end
def self.install
FileUtils.mkdir_p CREW_DEST_HOME.to_s
FileUtils.mkdir_p "#{CREW_DEST_PREFIX}/bin"
FileUtils.install 'linter', "#{CREW_DEST_PREFIX}/bin/linter", mode: 0o755
FileUtils.install 'linter', "#{CREW_DEST_PREFIX}/bin", mode: 0o755
FileUtils.install ['.mdlrc', '.mdl_style.rb'], CREW_DEST_HOME.to_s, mode: 0o644
end
end