未验证 提交 ea37ccdd 编写于 作者: B bogdanvlviv

Fix rubocop offenses

- Layout/TrailingWhitespace

```
actionpack/lib/action_controller/metal/request_forgery_protection.rb:49:4:
C: Layout/TrailingWhitespace: Trailing whitespace detected.
  #
   ^
```

Related to c3787494

- Performance/StartWith

```
tasks/release.rb:108:44: C: Performance/StartWith:
Use String#start_with? instead of a regex match anchored to the beginning of the string.
      header += "*   No changes.\n\n\n" if current_contents =~ /\A##/
```
上级 e715a647
...@@ -46,7 +46,7 @@ class InvalidCrossOriginRequest < ActionControllerError #:nodoc: ...@@ -46,7 +46,7 @@ class InvalidCrossOriginRequest < ActionControllerError #:nodoc:
# allowed via {CORS}[https://en.wikipedia.org/wiki/Cross-origin_resource_sharing] # allowed via {CORS}[https://en.wikipedia.org/wiki/Cross-origin_resource_sharing]
# will also be able to create XHR requests. Be sure to check your # will also be able to create XHR requests. Be sure to check your
# CORS whitelist before disabling forgery protection for XHR. # CORS whitelist before disabling forgery protection for XHR.
# #
# CSRF protection is turned on with the <tt>protect_from_forgery</tt> method. # CSRF protection is turned on with the <tt>protect_from_forgery</tt> method.
# By default <tt>protect_from_forgery</tt> protects your session with # By default <tt>protect_from_forgery</tt> protects your session with
# <tt>:null_session</tt> method, which provides an empty session # <tt>:null_session</tt> method, which provides an empty session
......
...@@ -105,7 +105,7 @@ ...@@ -105,7 +105,7 @@
current_contents = File.read(fname) current_contents = File.read(fname)
header = "## Rails #{version} (#{Date.today.strftime('%B %d, %Y')}) ##\n\n" header = "## Rails #{version} (#{Date.today.strftime('%B %d, %Y')}) ##\n\n"
header += "* No changes.\n\n\n" if current_contents =~ /\A##/ header += "* No changes.\n\n\n" if current_contents.start_with?("##")
contents = header + current_contents contents = header + current_contents
File.write(fname, contents) File.write(fname, contents)
end end
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册