Skip to content

Commit

Permalink
Merge pull request Moya#1748 from maxxx777/enhancement/enable-danger-…
Browse files Browse the repository at this point in the history
…prose-plugin

Enhancement/enable danger prose plugin
  • Loading branch information
SD10 authored Dec 5, 2018
2 parents fbdb37b + 625204c commit b68e852
Show file tree
Hide file tree
Showing 3 changed files with 23 additions and 0 deletions.
3 changes: 3 additions & 0 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,9 @@ jobs:
- run:
name: Install Swiftlint
command: brew install swiftlint
- run:
name: Add Python directory to PATH
command: echo 'export PATH=~/Library/Python/2.7/bin:$PATH' >> $BASH_ENV
- run:
name: Install Ruby Dependencies
command: bundle check || bundle install
Expand Down
19 changes: 19 additions & 0 deletions Dangerfile
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,25 @@ 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 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 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 added_and_modified_en_docs
end

# Wrapper for package manifest file name and update status
PackageManifest = Struct.new(:fileName, :updated)

Expand Down
1 change: 1 addition & 0 deletions Gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -9,4 +9,5 @@ gem 'octokit', '~> 4.3'
gem 'danger'
gem 'danger-swiftlint'
gem 'danger-xcode_summary'
gem 'danger-prose'
gem 'xcpretty-json-formatter'

0 comments on commit b68e852

Please sign in to comment.