From 680b9f8a6cba0e0a11763ce824c2fac94ce1a087 Mon Sep 17 00:00:00 2001 From: Alexander Popov Date: Sat, 18 Apr 2020 01:24:41 +0300 Subject: [PATCH] Add EditorConfig file Resolve issues. More info here: https://editorconfig.org/ --- .editorconfig | 9 +++ .rspec | 2 +- .yardopts | 2 +- UPGRADING.md | 1 - docs/README.md | 2 +- docs/_includes/docs_nav.md | 2 +- docs/_includes/footer.html | 2 +- docs/_includes/header.html | 92 +++++++++++------------ docs/_sass/_variables.scss | 2 +- docs/_sass/faraday.sass | 1 - docs/assets/css/main.scss | 2 +- docs/assets/js/team.js | 2 +- docs/middleware/list.md | 2 +- docs/middleware/request/authentication.md | 2 +- docs/middleware/request/multipart.md | 8 +- docs/middleware/request/retry.md | 2 +- docs/middleware/response/logger.md | 6 +- docs/middleware/response/raise_error.md | 2 +- 18 files changed, 74 insertions(+), 67 deletions(-) create mode 100644 .editorconfig diff --git a/.editorconfig b/.editorconfig new file mode 100644 index 000000000..c6c8b3621 --- /dev/null +++ b/.editorconfig @@ -0,0 +1,9 @@ +root = true + +[*] +indent_style = space +indent_size = 2 +end_of_line = lf +charset = utf-8 +trim_trailing_whitespace = true +insert_final_newline = true diff --git a/.rspec b/.rspec index bb697427e..7a2cc1a6e 100644 --- a/.rspec +++ b/.rspec @@ -1,3 +1,3 @@ --require spec_helper --format documentation ---color \ No newline at end of file +--color diff --git a/.yardopts b/.yardopts index e1ba7b869..87bde0f1e 100644 --- a/.yardopts +++ b/.yardopts @@ -9,4 +9,4 @@ lib/**/*.rb - -CHANGELOG.md \ No newline at end of file +CHANGELOG.md diff --git a/UPGRADING.md b/UPGRADING.md index 7d65d01f9..0d7df3b08 100644 --- a/UPGRADING.md +++ b/UPGRADING.md @@ -57,4 +57,3 @@ conn = Faraday.new(...) do |f| f.adapter AnyAdapter end ``` - diff --git a/docs/README.md b/docs/README.md index 26127d74a..6b3b24a18 100644 --- a/docs/README.md +++ b/docs/README.md @@ -16,4 +16,4 @@ $ bundle exec jekyll serve # The site will now be reachable at http://127.0.0.1:4000/faraday/ ``` -[website]: https://lostisland.github.io/faraday \ No newline at end of file +[website]: https://lostisland.github.io/faraday diff --git a/docs/_includes/docs_nav.md b/docs/_includes/docs_nav.md index ee9ac6869..995f76d3b 100644 --- a/docs/_includes/docs_nav.md +++ b/docs/_includes/docs_nav.md @@ -15,4 +15,4 @@ {{ page.next_name }} {% endif %}

- \ No newline at end of file + diff --git a/docs/_includes/footer.html b/docs/_includes/footer.html index 8ac5e7176..9c1d5971b 100644 --- a/docs/_includes/footer.html +++ b/docs/_includes/footer.html @@ -18,4 +18,4 @@ inputSelector: '#search-box', debug: false // Set debug to true if you want to inspect the dropdown }); - \ No newline at end of file + diff --git a/docs/_includes/header.html b/docs/_includes/header.html index 224327b2e..0f7f6d597 100644 --- a/docs/_includes/header.html +++ b/docs/_includes/header.html @@ -1,50 +1,50 @@ \ No newline at end of file + diff --git a/docs/_sass/_variables.scss b/docs/_sass/_variables.scss index f6284ab89..10757503e 100644 --- a/docs/_sass/_variables.scss +++ b/docs/_sass/_variables.scss @@ -6,4 +6,4 @@ $link-color: #EE4266; $text-color: #3C3C3C; $font-family-main: 'KohinoorTelugu-Regular', Helvetica, Arial, sans-serif; $font-family-headings: 'Raleway', Helvetica, Arial, sans-serif; -$search-color: #EE4266; \ No newline at end of file +$search-color: #EE4266; diff --git a/docs/_sass/faraday.sass b/docs/_sass/faraday.sass index e79905cab..2d9ee5d11 100644 --- a/docs/_sass/faraday.sass +++ b/docs/_sass/faraday.sass @@ -127,4 +127,3 @@ footer // when needing search usually @media screen and (max-width: 800px) display: none - diff --git a/docs/assets/css/main.scss b/docs/assets/css/main.scss index e83a3d4b7..7dd10c7c7 100644 --- a/docs/assets/css/main.scss +++ b/docs/assets/css/main.scss @@ -4,4 +4,4 @@ @import "variables"; @import "type-theme"; @import "faraday"; -@import "https://cdn.jsdelivr.net/npm/docsearch.js@2/dist/cdn/docsearch.min.css" \ No newline at end of file +@import "https://cdn.jsdelivr.net/npm/docsearch.js@2/dist/cdn/docsearch.min.css" diff --git a/docs/assets/js/team.js b/docs/assets/js/team.js index 5c61fcbdc..66773ce32 100644 --- a/docs/assets/js/team.js +++ b/docs/assets/js/team.js @@ -46,4 +46,4 @@ fetch('https://api.github.com/repos/lostisland/faraday/stats/contributors') hideLoader(); showTeam(); }); - }); \ No newline at end of file + }); diff --git a/docs/middleware/list.md b/docs/middleware/list.md index e912c195c..59d9ba2ae 100644 --- a/docs/middleware/list.md +++ b/docs/middleware/list.md @@ -13,7 +13,7 @@ Faraday ships with some useful middleware that you can use to customize your req Middleware are separated into two macro-categories: **Request Middleware** and **Response Middleware**. The former usually deal with the request, encoding the parameters or setting headers. The latter instead activate after the request is completed and a response has been received, like -parsing the response body, logging useful info or checking the response status. +parsing the response body, logging useful info or checking the response status. ### Request Middleware diff --git a/docs/middleware/request/authentication.md b/docs/middleware/request/authentication.md index 00771c71f..867efa187 100644 --- a/docs/middleware/request/authentication.md +++ b/docs/middleware/request/authentication.md @@ -27,4 +27,4 @@ end Faraday.new(...) do |conn| conn.token_auth('authentication-token') end -``` \ No newline at end of file +``` diff --git a/docs/middleware/request/multipart.md b/docs/middleware/request/multipart.md index cc70dea76..7585acd1f 100644 --- a/docs/middleware/request/multipart.md +++ b/docs/middleware/request/multipart.md @@ -25,7 +25,7 @@ can be specified with a String path to a local file, or an IO object. * `Faraday::ParamPart` wraps a String value with a Content-Type, and optionally a Content-ID. -Note: `Faraday::ParamPart` was added in Faraday v0.16.0. Before that, +Note: `Faraday::ParamPart` was added in Faraday v0.16.0. Before that, `Faraday::FilePart` was called `Faraday::UploadIO`. ### Example Usage @@ -47,13 +47,13 @@ payload = { string: 'value' } payload[:file] = Faraday::FilePart.new(__FILE__, 'text/x-ruby') # specify filename because IO object doesn't know it -payload[:file_with_name] = Faraday::FilePart.new(File.open(__FILE__), - 'text/x-ruby', +payload[:file_with_name] = Faraday::FilePart.new(File.open(__FILE__), + 'text/x-ruby', File.basename(__FILE__)) # Sets a custom Content-Disposition: # nil filename still defaults to File.basename(__FILE__) -payload[:file_with_header] = Faraday::FilePart.new(__FILE__, +payload[:file_with_header] = Faraday::FilePart.new(__FILE__, 'text/x-ruby', nil, 'Content-Disposition' => 'form-data; foo=1') diff --git a/docs/middleware/request/retry.md b/docs/middleware/request/retry.md index 940a06001..04bf42e46 100644 --- a/docs/middleware/request/retry.md +++ b/docs/middleware/request/retry.md @@ -120,7 +120,7 @@ response_statuses = [] retry_options = { retry_block: -> (env, options, retries, exc) { response_statuses << env.status } } -``` +``` [raise_error]: ../middleware/raise-error diff --git a/docs/middleware/response/logger.md b/docs/middleware/response/logger.md index 069382a3f..45232d1fe 100644 --- a/docs/middleware/response/logger.md +++ b/docs/middleware/response/logger.md @@ -86,7 +86,7 @@ end You can also provide a custom formatter to control how requests and responses are logged. Any custom formatter MUST implement the `request` and `response` method, with one argument which -will be passed being the Faraday environment. +will be passed being the Faraday environment. If you make your formatter inheriting from `Faraday::Response::Logger::Formatter`, then the methods `debug`, `info`, `warn`, `error` and `fatal` are automatically delegated to the logger. @@ -98,7 +98,7 @@ class MyFormatter < Faraday::Logging::Formatter end def response(env) - # Build a custom message using `env` + # Build a custom message using `env` info('Response') { 'Response Received' } end end @@ -106,4 +106,4 @@ end conn = Faraday.new(url: 'http://sushi.com/api_key=s3cr3t') do |faraday| faraday.response :logger, nil, formatter: MyFormatter end -``` \ No newline at end of file +``` diff --git a/docs/middleware/response/raise_error.md b/docs/middleware/response/raise_error.md index 286d0fbb8..9379c8a4c 100644 --- a/docs/middleware/response/raise_error.md +++ b/docs/middleware/response/raise_error.md @@ -19,7 +19,7 @@ begin rescue Faraday::ResourceNotFound => e e.response[:status] #=> 404 e.response[:headers] #=> { ... } - e.response[:body] #=> "..." + e.response[:body] #=> "..." end ```