Skip to content
This repository was archived by the owner on Jan 18, 2026. It is now read-only.

Commit 716ffcb

Browse files
author
Erazem Kokot
committed
Update contributing guide
1 parent 4ec31e0 commit 716ffcb

1 file changed

Lines changed: 39 additions & 31 deletions

File tree

CONTRIBUTING.md

Lines changed: 39 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -1,53 +1,61 @@
1-
# Contributing code
1+
# Anarchy's contributing guide
22

3-
* Follow shell scripting best practices (mostly as described in
3+
You can help contribute to Anarchy in many ways, including
4+
5+
## Writing code
6+
7+
* Follow shell scripting best practices (e.g. as described in
48
[Google's shell style guide](https://google.github.io/styleguide/shell.xml))
5-
* Try to be POSIX compliant (if that's not possible target bash)
6-
* Use `${variable}` instead of `$variable`
7-
* Constants should be `UPPER_CASE`, other variables `lower_case`
9+
* Try to be POSIX compliant
10+
* Use `"${variable}"` instead of `$variable`
11+
* Constants (and global variables) should be in `UPPER_CASE`, other variables
12+
should be in `lower_case`
813
* Use single square brackets (`[ condition ]`) for conditionals
914
(e.g. in 'if' statements)
10-
* Write good comments where needed (e.g. in complicated loops/functions)
11-
* Use different error codes when exiting (0 for proper exit, 1+ for error exits)
12-
and explain them at the top of the file
13-
* Use the `log` function as much as possible (as long as it makes sense)
15+
* Write clean and readable code
16+
* Write comments where needed (e.g. explaining functions)
17+
* Explain what arguments a function takes (if any)
18+
* Use different error codes when exiting and explain when they occur
19+
at the top of the file
20+
* If you've created a new file or made big changes (judge this by yourself),
21+
you can add a copyright disclaimer below the shebang and any other copyright
22+
notices (e.g. `Copyright (C) Jane Doe <contact@jane.doe>`)
23+
* Use the `log` function if necessary
1424
* Always line wrap at 80 characters
15-
* Scripts don't need a `.sh` suffix and should have a `-` between words
16-
* Libraries (`libs` directory) should always have a `.sh` suffix and an
17-
explanation of what they do
25+
* Scripts are named `setup-*` (without a `.sh` extension)
26+
* Libraries (`lib` directory) should always have a `.sh` suffix and NO shebang
1827
* Neither script nor libraries should be executable (their permissions are
1928
set during compilation)
29+
* Use shellscript to error-check your code
30+
* Test your code before submitting a PR (unless it's a draft)
2031

21-
Check for compliance and errors with [shellcheck](https://www.shellcheck.net/):
22-
23-
`shellcheck -s sh -x <script>`
24-
25-
**Always test your scripts before submitting the PR.**
26-
27-
If you need help remembering commands or want to check out some tips
28-
visit [devhints.io](https://devhints.io/bash) to do so.
29-
30-
# Translating
32+
## Translating (updating existing translations)
3133

3234
Anarchy Linux supports a bunch of languages, most of which need maintainers.
3335

3436
* Make sure to use the UTF-8 encoding
35-
* Don't change the variable names (e.g. intro_msg=)
36-
* Don't remove any occurrence of (e.g. \n or \n\n - new lines)
37-
* Don't remove any special characters (e.g. $a, or quotes)
38-
* Don't edit variables within the text (e.g. /dev/${DRIVE} or ${user})
39-
* Add yourself to the maintainers list
40-
(and your email for possible further communication)
37+
* Don't change the variable names (e.g. `intro_msg=`)
38+
* Don't remove any occurrence of `\n` or `\n\n` (new lines)
39+
* Don't remove any special characters (e.g. `$a` or quotes)
40+
* Don't edit variables within the text (e.g. `/dev/${DRIVE}` or `${user}`)
4141
* Compare the finished file with english.conf
42+
* If you intend to maintain the translation, add yourself as a maintainer
43+
at the top of the file (example below)
44+
* If there are existing maintainers, add yourself on a new line below theirs
45+
46+
```
47+
# Maintainer: John Doe <contact@john.doe>
48+
# Maintainer: Jane Doe <contact@jane.doe>
49+
```
4250

4351
_Comparing language files to one another makes Anarchy more consistent
4452
and easier to update in the future._
4553

46-
## Translating new languages
54+
## Translating Anarchy to new languages
4755

4856
* Ask yourself if you're committed enough to translate the whole file
4957
(check english.conf for size comparison - ~500 translations)
5058
* Copy the `english.conf` file and rename it to your language's
51-
english name (e.g. "portuguese.conf" or "spanish.conf")
59+
english name (e.g. `portuguese.conf` or `spanish.conf`)
5260
* Change the LANG variable to your language's UTF-8 locale (e.g. `sl_SI.UTF-8`)
53-
* Check general rules/recommendations below
61+
* Read above recommendations

0 commit comments

Comments
 (0)