Skip to content

Commit

Permalink
Run lint and check spelling only on added and modified doc files
Browse files Browse the repository at this point in the history
  • Loading branch information
maxxx777 committed Dec 2, 2018
1 parent f53ddc4 commit 625204c
Showing 1 changed file with 11 additions and 7 deletions.
18 changes: 11 additions & 7 deletions Dangerfile
Original file line number Diff line number Diff line change
Expand Up @@ -47,19 +47,23 @@ if has_app_changes && missing_doc_changes && doc_changes_recommended && not_decl
warn("Consider adding supporting documentation to this change. Documentation can be found in the `docs` directory.")
end

# Run danger-prose to lint doc files if docs modified
if en_docs_modified || cn_docs_modified
prose.lint_files "docs/*.md"
prose.lint_files "docs_CN/*.md"
# Run danger-prose to lint Chinese docs
added_and_modified_cn_docs = (git.added_files.grep(%r{docs_CN/*.md}) + git.modified_files.grep(%r{docs_CN/*.md}))
if added_and_modified_cn_docs.empty?
prose.lint_files added_and_modified_cn_docs
end

# Run danger-prose to check spelling doc files if docs modified
if en_docs_modified
# Run danger-prose to lint and check spelling English docs
added_and_modified_en_docs = (git.added_files.grep(%r{docs/*.md}) + git.modified_files.grep(%r{docs/*.md}))
if added_and_modified_en_docs.empty?
prose.lint_files added_and_modified_en_docs

prose.language = "en-us"
prose.ignored_words = ["Auth", "auth", "Moya", "enum", "enums", "OAuth", "Artsy's", "Heimdallr.swift", "SwiftyJSONMapper", "ObjectMapper", "Argo", "ModelMapper", "ReactiveSwift", "RxSwift", "multipart", "JSONEncoder", "Alamofire", "CocoaPods", "URLSession", "plugin", "plugins", "stubClosure", "requestClosure", "endpointClosure", "Unsplash", "ReactorKit", "Dribbble", "EVReflection", "Unbox"]
prose.ignore_acronyms = true
prose.ignore_numbers = true
prose.check_spelling "docs/*.md"

prose.check_spelling added_and_modified_en_docs
end

# Wrapper for package manifest file name and update status
Expand Down

0 comments on commit 625204c

Please sign in to comment.