Kicksecure Coding Style
Simplicity, Brevity, Sparingly Forking Upstream Projects, Feature Removability
Contents
stub[edit]
Copy or share this direct link!
Click = Copy
Copied to clipboard!
https://www.kicksecure.com/wiki/Dev/coding_style#stub
Click below ↴ = Copy to Clipboard
Click = Copy
Copied to clipboard!
[[Dev/coding_style#stub|stub]]
Copy as Wikitext
Click = Copy
Copied to clipboard!
[stub](https://www.kicksecure.com/wiki/Dev/coding_style#stub)
for Discourse, reddit, GitHub
Click = Copy
Copied to clipboard!
[stub](https://www.kicksecure.com/wiki/Dev/coding_style#stub)
Copy as Markdown
Click = Copy
Copied to clipboard!
[url=https://www.kicksecure.com/wiki/Dev/coding_style#stub]stub[/url]
Copy as phpBB
Click below ↴ = Open social URL with share data
We don't use embedded scripts
This share button is completely self-hosted by this webserver. No scripts from any of the social networks are embedded on this webserver. See also
Social Share Button.
Documentation for this is incomplete. Contributions are happily considered! See this for potential alternatives.
Simplicity[edit]
Copy or share this direct link!
Click = Copy
Copied to clipboard!
https://www.kicksecure.com/wiki/Dev/coding_style#Simplicity
Click below ↴ = Copy to Clipboard
Click = Copy
Copied to clipboard!
[[Dev/coding_style#Simplicity|Simplicity]]
Copy as Wikitext
Click = Copy
Copied to clipboard!
[Simplicity](https://www.kicksecure.com/wiki/Dev/coding_style#Simplicity)
for Discourse, reddit, GitHub
Click = Copy
Copied to clipboard!
[Simplicity](https://www.kicksecure.com/wiki/Dev/coding_style#Simplicity)
Copy as Markdown
Click = Copy
Copied to clipboard!
[url=https://www.kicksecure.com/wiki/Dev/coding_style#Simplicity]Simplicity[/url]
Copy as phpBB
Click below ↴ = Open social URL with share data
We don't use embedded scripts
This share button is completely self-hosted by this webserver. No scripts from any of the social networks are embedded on this webserver. See also
Social Share Button.
For lack of a better term, Kicksecure is simple. It does not fork or recompile software packages from upstream projects.
Examples of software where it is often assumed that it is being modified by Kicksecure, or questions arise about whether that is the case:
- No good examples yet.
This has the advantage that questions and issues caused by upstream projects can be redirected upstream, as per the Self Support First Policy. This reduces the maintenance load on the Kicksecure project.
Issues that cannot be caused by a Linux distribution are sometimes mistakenly attributed to that distribution. Examples:
- https://www.mail-archive.com/qubes-users@googlegroups.com/msg29899.html
- https://www.mail-archive.com/qubes-users@googlegroups.com/msg29573.html
- https://forums.whonix.org/t/monero-and-whonix-15-0-1-5-1-bug/10532
Related: Relationship With Upstream
Brevity[edit]
Copy or share this direct link!
Click = Copy
Copied to clipboard!
https://www.kicksecure.com/wiki/Dev/coding_style#Brevity
Click below ↴ = Copy to Clipboard
Click = Copy
Copied to clipboard!
[[Dev/coding_style#Brevity|Brevity]]
Copy as Wikitext
Click = Copy
Copied to clipboard!
[Brevity](https://www.kicksecure.com/wiki/Dev/coding_style#Brevity)
for Discourse, reddit, GitHub
Click = Copy
Copied to clipboard!
[Brevity](https://www.kicksecure.com/wiki/Dev/coding_style#Brevity)
Copy as Markdown
Click = Copy
Copied to clipboard!
[url=https://www.kicksecure.com/wiki/Dev/coding_style#Brevity]Brevity[/url]
Copy as phpBB
Click below ↴ = Open social URL with share data
We don't use embedded scripts
This share button is completely self-hosted by this webserver. No scripts from any of the social networks are embedded on this webserver. See also
Social Share Button.
In most cases, goals should be achieved using a single implementation. For example, if remounting /run
with more secure mount options is required, the implementation should do this, if possible, either entirely in initramfs
/ dracut
or entirely using systemd
. It should not duplicate the same functionality in both.
There are numerous things that users might potentially do, which may not align with Kicksecure developers' perspectives. For instance, there is the hello package, which most users are unaware of and unlikely to install. This is merely an example, and no criticism is intended toward the contributor of that Debian package.
Why allow the installation of that package? What if that contributor turned malicious and included a backdoor in the hello
package? To prevent such a backdoor from causing harm, an apt wrapper could be implemented to prevent the installation of such unnecessary packages. However, introducing such a wrapper would likely be worse than the hypothetical risk itself.
Feature Removability[edit]
Copy or share this direct link!
Click = Copy
Copied to clipboard!
https://www.kicksecure.com/wiki/Dev/coding_style#Feature_Removability
Click below ↴ = Copy to Clipboard
Click = Copy
Copied to clipboard!
[[Dev/coding_style#Feature_Removability|Feature Removability]]
Copy as Wikitext
Click = Copy
Copied to clipboard!
[Feature Removability](https://www.kicksecure.com/wiki/Dev/coding_style#Feature_Removability)
for Discourse, reddit, GitHub
Click = Copy
Copied to clipboard!
[Feature Removability](https://www.kicksecure.com/wiki/Dev/coding_style#Feature_Removability)
Copy as Markdown
Click = Copy
Copied to clipboard!
[url=https://www.kicksecure.com/wiki/Dev/coding_style#Feature_Removability]Feature Removability[/url]
Copy as phpBB
Click below ↴ = Open social URL with share data
We don't use embedded scripts
This share button is completely self-hosted by this webserver. No scripts from any of the social networks are embedded on this webserver. See also
Social Share Button.
If a feature becomes unmaintainable, there must be a way to remove it for users who upgrade their system using apt
.
No Trailing Whitespaces[edit]
Copy or share this direct link!
Click = Copy
Copied to clipboard!
https://www.kicksecure.com/wiki/Dev/coding_style#No_Trailing_Whitespaces
Click below ↴ = Copy to Clipboard
Click = Copy
Copied to clipboard!
[[Dev/coding_style#No_Trailing_Whitespaces|No Trailing Whitespaces]]
Copy as Wikitext
Click = Copy
Copied to clipboard!
[No Trailing Whitespaces](https://www.kicksecure.com/wiki/Dev/coding_style#No_Trailing_Whitespaces)
for Discourse, reddit, GitHub
Click = Copy
Copied to clipboard!
[No Trailing Whitespaces](https://www.kicksecure.com/wiki/Dev/coding_style#No_Trailing_Whitespaces)
Copy as Markdown
Click = Copy
Copied to clipboard!
[url=https://www.kicksecure.com/wiki/Dev/coding_style#No_Trailing_Whitespaces]No Trailing Whitespaces[/url]
Copy as phpBB
Click below ↴ = Open social URL with share data
We don't use embedded scripts
This share button is completely self-hosted by this webserver. No scripts from any of the social networks are embedded on this webserver. See also
Social Share Button.
Use a proper editor and ensure no trailing whitespace is left at the end of lines.
Indentation[edit]
Copy or share this direct link!
Click = Copy
Copied to clipboard!
https://www.kicksecure.com/wiki/Dev/coding_style#Indentation
Click below ↴ = Copy to Clipboard
Click = Copy
Copied to clipboard!
[[Dev/coding_style#Indentation|Indentation]]
Copy as Wikitext
Click = Copy
Copied to clipboard!
[Indentation](https://www.kicksecure.com/wiki/Dev/coding_style#Indentation)
for Discourse, reddit, GitHub
Click = Copy
Copied to clipboard!
[Indentation](https://www.kicksecure.com/wiki/Dev/coding_style#Indentation)
Copy as Markdown
Click = Copy
Copied to clipboard!
[url=https://www.kicksecure.com/wiki/Dev/coding_style#Indentation]Indentation[/url]
Copy as phpBB
Click below ↴ = Open social URL with share data
We don't use embedded scripts
This share button is completely self-hosted by this webserver. No scripts from any of the social networks are embedded on this webserver. See also
Social Share Button.
Avoid excessive levels of if
conditions and similar constructs.
- Bad example:**
machine_id() { if ! test -f /etc/machine-id ; then existing_machine_id="$(cat /etc/machine-id)" ## ... fi }
In the above example, there is no need to nest everything inside the if
block. This is especially important when dealing with multiple levels of conditionals.
- Good example:**
machine_id() { if ! test -f /etc/machine-id ; then return 0 fi existing_machine_id="$(cat /etc/machine-id)" ## .... }
Shell Scripts[edit]
Copy or share this direct link!
Click = Copy
Copied to clipboard!
https://www.kicksecure.com/wiki/Dev/coding_style#Shell_Scripts
Click below ↴ = Copy to Clipboard
Click = Copy
Copied to clipboard!
[[Dev/coding_style#Shell_Scripts|Shell Scripts]]
Copy as Wikitext
Click = Copy
Copied to clipboard!
[Shell Scripts](https://www.kicksecure.com/wiki/Dev/coding_style#Shell_Scripts)
for Discourse, reddit, GitHub
Click = Copy
Copied to clipboard!
[Shell Scripts](https://www.kicksecure.com/wiki/Dev/coding_style#Shell_Scripts)
Copy as Markdown
Click = Copy
Copied to clipboard!
[url=https://www.kicksecure.com/wiki/Dev/coding_style#Shell_Scripts]Shell Scripts[/url]
Copy as phpBB
Click below ↴ = Open social URL with share data
We don't use embedded scripts
This share button is completely self-hosted by this webserver. No scripts from any of the social networks are embedded on this webserver. See also
Social Share Button.
Avoid sed
and awk
whenever possible[edit]
Copy or share this direct link!
Click = Copy
Copied to clipboard!
https://www.kicksecure.com/wiki/Dev/coding_style#Avoid_sed_and_awk_whenever_possible
Click below ↴ = Copy to Clipboard
Click = Copy
Copied to clipboard!
[[Dev/coding_style#Avoid_sed_and_awk_whenever_possible|Avoid sed and awk whenever possible]]
Copy as Wikitext
Click = Copy
Copied to clipboard!
[Avoid sed and awk whenever possible](https://www.kicksecure.com/wiki/Dev/coding_style#Avoid_sed_and_awk_whenever_possible)
for Discourse, reddit, GitHub
Click = Copy
Copied to clipboard!
[Avoid sed and awk whenever possible](https://www.kicksecure.com/wiki/Dev/coding_style#Avoid_sed_and_awk_whenever_possible)
Copy as Markdown
Click = Copy
Copied to clipboard!
[url=https://www.kicksecure.com/wiki/Dev/coding_style#Avoid_sed_and_awk_whenever_possible]Avoid sed and awk whenever possible[/url]
Copy as phpBB
Click below ↴ = Open social URL with share data
We don't use embedded scripts
This share button is completely self-hosted by this webserver. No scripts from any of the social networks are embedded on this webserver. See also
Social Share Button.
There may be older code (from before the introduction of str_replace
) that uses sed
or awk
. Patches are welcome to migrate such cases to str_replace
.
Use str_replace
whenever possible[edit]
Copy or share this direct link!
Click = Copy
Copied to clipboard!
https://www.kicksecure.com/wiki/Dev/coding_style#Use_str_replace_whenever_possible
Click below ↴ = Copy to Clipboard
Click = Copy
Copied to clipboard!
[[Dev/coding_style#Use_str_replace_whenever_possible|Use str_replace whenever possible]]
Copy as Wikitext
Click = Copy
Copied to clipboard!
[Use str_replace whenever possible](https://www.kicksecure.com/wiki/Dev/coding_style#Use_str_replace_whenever_possible)
for Discourse, reddit, GitHub
Click = Copy
Copied to clipboard!
[Use str_replace whenever possible](https://www.kicksecure.com/wiki/Dev/coding_style#Use_str_replace_whenever_possible)
Copy as Markdown
Click = Copy
Copied to clipboard!
[url=https://www.kicksecure.com/wiki/Dev/coding_style#Use_str_replace_whenever_possible]Use str_replace whenever possible[/url]
Copy as phpBB
Click below ↴ = Open social URL with share data
We don't use embedded scripts
This share button is completely self-hosted by this webserver. No scripts from any of the social networks are embedded on this webserver. See also
Social Share Button.
str_replace is installed by default in Kicksecure (man page
). [1]
Use type -P
instead of which
[edit]
Copy or share this direct link!
Click = Copy
Copied to clipboard!
https://www.kicksecure.com/wiki/Dev/coding_style#Use_type_-P_instead_of_which
Click below ↴ = Copy to Clipboard
Click = Copy
Copied to clipboard!
[[Dev/coding_style#Use_type_-P_instead_of_which|Use type -P instead of which]]
Copy as Wikitext
Click = Copy
Copied to clipboard!
[Use type -P instead of which](https://www.kicksecure.com/wiki/Dev/coding_style#Use_type_-P_instead_of_which)
for Discourse, reddit, GitHub
Click = Copy
Copied to clipboard!
[Use type -P instead of which](https://www.kicksecure.com/wiki/Dev/coding_style#Use_type_-P_instead_of_which)
Copy as Markdown
Click = Copy
Copied to clipboard!
[url=https://www.kicksecure.com/wiki/Dev/coding_style#Use_type_-P_instead_of_which]Use type -P instead of which[/url]
Copy as phpBB
Click below ↴ = Open social URL with share data
We don't use embedded scripts
This share button is completely self-hosted by this webserver. No scripts from any of the social networks are embedded on this webserver. See also
Social Share Button.
Do not use which
. Instead, use type -P
.
https://mywiki.wooledge.org/BashFAQ/081
Proper Whitespace Handling[edit]
Copy or share this direct link!
Click = Copy
Copied to clipboard!
https://www.kicksecure.com/wiki/Dev/coding_style#Proper_Whitespace_Handling
Click below ↴ = Copy to Clipboard
Click = Copy
Copied to clipboard!
[[Dev/coding_style#Proper_Whitespace_Handling|Proper Whitespace Handling]]
Copy as Wikitext
Click = Copy
Copied to clipboard!
[Proper Whitespace Handling](https://www.kicksecure.com/wiki/Dev/coding_style#Proper_Whitespace_Handling)
for Discourse, reddit, GitHub
Click = Copy
Copied to clipboard!
[Proper Whitespace Handling](https://www.kicksecure.com/wiki/Dev/coding_style#Proper_Whitespace_Handling)
Copy as Markdown
Click = Copy
Copied to clipboard!
[url=https://www.kicksecure.com/wiki/Dev/coding_style#Proper_Whitespace_Handling]Proper Whitespace Handling[/url]
Copy as phpBB
Click below ↴ = Open social URL with share data
We don't use embedded scripts
This share button is completely self-hosted by this webserver. No scripts from any of the social networks are embedded on this webserver. See also
Social Share Button.
See Dev/bash.
See Also[edit]
Copy or share this direct link!
Click = Copy
Copied to clipboard!
https://www.kicksecure.com/wiki/Dev/coding_style#See_Also
Click below ↴ = Copy to Clipboard
Click = Copy
Copied to clipboard!
[[Dev/coding_style#See_Also|See Also]]
Copy as Wikitext
Click = Copy
Copied to clipboard!
[See Also](https://www.kicksecure.com/wiki/Dev/coding_style#See_Also)
for Discourse, reddit, GitHub
Click = Copy
Copied to clipboard!
[See Also](https://www.kicksecure.com/wiki/Dev/coding_style#See_Also)
Copy as Markdown
Click = Copy
Copied to clipboard!
[url=https://www.kicksecure.com/wiki/Dev/coding_style#See_Also]See Also[/url]
Copy as phpBB
Click below ↴ = Open social URL with share data
We don't use embedded scripts
This share button is completely self-hosted by this webserver. No scripts from any of the social networks are embedded on this webserver. See also
Social Share Button.


Copy as Wikitext

for Discourse, reddit, GitHub

Copy as Markdown

Copy as phpBB Click below ↴ = Open social URL with share data











We believe security software like Kicksecure needs to remain Open Source and independent. Would you help sustain and grow the project? Learn more about our 12 year success story and maybe DONATE!