summaryrefslogtreecommitdiff
path: root/CONTRIBUTING.md
diff options
context:
space:
mode:
authorGabriel F. T. Gomes <gabriel@inconstante.net.br>2020-08-03 18:43:13 -0300
committerGabriel F. T. Gomes <gabriel@inconstante.net.br>2020-08-03 18:43:13 -0300
commit95623d39d6029ba78ec96ad5ea08e9ac12629b91 (patch)
treeea0fe36eb5e6f40e0a1f765d44c4b0c0b2bfb089 /CONTRIBUTING.md
parent019f3cc463db63abc6460f97deb488deec43840b (diff)
downloadbash-completion-95623d39d6029ba78ec96ad5ea08e9ac12629b91.tar.gz
New upstream version 2.11upstream/2.11upstream
Diffstat (limited to 'CONTRIBUTING.md')
-rw-r--r--CONTRIBUTING.md23
1 files changed, 16 insertions, 7 deletions
diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md
index 7f5a0962..9c8292c1 100644
--- a/CONTRIBUTING.md
+++ b/CONTRIBUTING.md
@@ -50,10 +50,10 @@ Also, please bare the following coding guidelines in mind:
start interpreters. Use lightweight programs such as grep(1), awk(1)
and sed(1).
-- Use the full power of bash >= 4.1. We no longer support earlier bash
+- Use the full power of bash >= 4.2. We no longer support earlier bash
versions, so you may as well use all the features of that version of
bash to optimise your code. However, be careful when using features
- added since bash 4.1, since not everyone will be able to use them.
+ added since bash 4.2, since not everyone will be able to use them.
For example, extended globs often enable you to avoid the use of
external programs, which are expensive to fork and execute, so do
@@ -98,6 +98,16 @@ Also, please bare the following coding guidelines in mind:
These forms of parameter substitutions can also be used on arrays,
which makes them very powerful (if a little slow).
+- We want our completions to work in `posix` and `nounset` modes.
+
+ Unfortunately due to a bash < 5.1 bug, toggling POSIX mode interferes
+ with keybindings and should not be done. This rules out use of
+ process substitution which causes syntax errors in POSIX mode.
+
+ Instead of toggling `nounset` mode, make sure to test whether
+ variables are set (e.g. with `[[ -v varname ]]`) or use default
+ expansion (e.g. `${varname-}`).
+
- Prefer `compgen -W '...' -- $cur` over embedding `$cur` in external
command arguments (often e.g. sed, grep etc) unless there's a good
reason to embed it. Embedding user input in command lines can result
@@ -150,9 +160,9 @@ Also, please bare the following coding guidelines in mind:
use them, do so if there's no other sane way to do what you're doing.
The "Shell and Utilities" volume of the POSIX specification is a good
starting reference for portable use of various utilities, see
- http://pubs.opengroup.org/onlinepubs/9699919799/
+ <https://pubs.opengroup.org/onlinepubs/9699919799/>.
-- Use an editor that supports EditorConfig, see http://editorconfig.org/,
+- Use an editor that supports EditorConfig, see <https://editorconfig.org/>,
and format source code according to our settings.
- Read the existing source code for examples of how to solve
@@ -169,11 +179,10 @@ Also, please bare the following coding guidelines in mind:
is intended to do, fixes issues it intends to fix, etc.
- In addition to running the test suite, there are a few scripts in the test/
- dir that catch some common issues, see and use for example runLint and
- run-shellcheck.
+ dir that catch some common issues, see and use for example runLint.
- File bugs, enhancement, and pull requests at GitHub,
- https://github.com/scop/bash-completion.
+ <https://github.com/scop/bash-completion>.
Sending them to the developers might work too, but is really strongly
discouraged as bits are more likely to fall through the cracks that
way compared to the tracker. Just use GitHub. If that's not an