mirror of
https://github.com/chromebrew/chromebrew.git
synced 2026-01-09 07:28:01 -05:00
Linter 1.2 => 1.3 (#7794)
Co-authored-by: chronos <no-reply@github.com>
This commit is contained in:
11
.github/workflows/.mdl_style.rb
vendored
Normal file
11
.github/workflows/.mdl_style.rb
vendored
Normal 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
1
.github/workflows/.mdlrc
vendored
Normal file
@@ -0,0 +1 @@
|
||||
style '.mdl_style.rb'
|
||||
2
.github/workflows/Linters.yml
vendored
2
.github/workflows/Linters.yml
vendored
@@ -42,7 +42,7 @@ jobs:
|
||||
fi
|
||||
case $ext in
|
||||
md)
|
||||
mdl "$file"
|
||||
mdl -c .mdlrc "$file"
|
||||
;;
|
||||
rb)
|
||||
ruby=true
|
||||
|
||||
@@ -1,5 +0,0 @@
|
||||
all
|
||||
exclude_rule 'MD035'
|
||||
exclude_rule 'MD036'
|
||||
exclude_rule 'MD041'
|
||||
exclude_rule 'MD046'
|
||||
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user