From 29402e7e0e8615759e1b54d156ae38d59b3b8ca9 Mon Sep 17 00:00:00 2001 From: Alexander Popov Date: Thu, 18 Mar 2021 00:24:10 +0300 Subject: [PATCH] Add EditorConfig file More info here: https://editorconfig.org/ For example, `ruby/ruby` has it: https://github.com/ruby/ruby/blob/05ebaee/.editorconfig Also fix some offenses. --- .editorconfig | 13 +++++++++++++ README.md | 1 - misc/rb_optparse.bash | 2 +- misc/rb_optparse.zsh | 4 ++-- test/optparse/test_acceptable.rb | 1 - 5 files changed, 16 insertions(+), 5 deletions(-) create mode 100644 .editorconfig diff --git a/.editorconfig b/.editorconfig new file mode 100644 index 0000000..9009c0a --- /dev/null +++ b/.editorconfig @@ -0,0 +1,13 @@ +root = true + +[*] +indent_style = space +indent_size = 2 +end_of_line = lf +charset = utf-8 +trim_trailing_whitespace = true +insert_final_newline = true +max_line_length = 80 + +[*.zsh] +indent_size = 4 diff --git a/README.md b/README.md index bfd9a4a..67d829f 100644 --- a/README.md +++ b/README.md @@ -57,4 +57,3 @@ To install this gem onto your local machine, run `bundle exec rake install`. To ## Contributing Bug reports and pull requests are welcome on GitHub at https://github.com/ruby/optparse. - diff --git a/misc/rb_optparse.bash b/misc/rb_optparse.bash index 8a59ec2..eece08d 100644 --- a/misc/rb_optparse.bash +++ b/misc/rb_optparse.bash @@ -16,5 +16,5 @@ _rb_optparse() { } rb_optparse () { - [ $# = 0 ] || complete -o default -F _rb_optparse "$@" + [ $# = 0 ] || complete -o default -F _rb_optparse "$@" } diff --git a/misc/rb_optparse.zsh b/misc/rb_optparse.zsh index a08b3dd..90e1128 100755 --- a/misc/rb_optparse.zsh +++ b/misc/rb_optparse.zsh @@ -24,8 +24,8 @@ generate-complete-function/ruby/optparse () mkdir -p "${ZSH_COMPLETION_DIR-$HOME/.zsh.d/Completion}" $1 "--*-completion-zsh=${1:t}" >! "${ZSH_COMPLETION_DIR-$HOME/.zsh.d/Completion}/$cmpl" if [[ $(type -w "$cmpl") == "${cmpl}: function" ]]; then - unfunction "$cmpl" - autoload -U "$cmpl" + unfunction "$cmpl" + autoload -U "$cmpl" else compinit "$cmpl" fi diff --git a/test/optparse/test_acceptable.rb b/test/optparse/test_acceptable.rb index 5c3fbdb..12f7886 100644 --- a/test/optparse/test_acceptable.rb +++ b/test/optparse/test_acceptable.rb @@ -196,4 +196,3 @@ def test_decimal_numeric end end -