Desktop entries and source files to create new files (at this point only scripts) according to best practices.
Content goes to ~/.local/share/templates/
.
The files should then appear under "Right click -> Create New" in Dolphin.
The icons have been hand-selected from the choices that are available on Manjaro KDE by default. No guarantee that your system will have them.
- bash template
- Use env instead of bash directly:
#!/usr/bin/env bash
- Use Bash Strict Mode:
set -euo pipefail
IFS=$'\n\t'
- Automatically check script with ShellCheck. Remove this production:
shellcheck "$0"
- C++ template
- Do not use
using namespace std;
(isocpp).
- Makefile template
- Use
.PHONY
:
.PHONY: default all clean
- Use
$(RM)
inmake clean
:
clean:
$(RM) files
- Python template
- Use env instead of
python3
directly. - Explicitly use
python3
. - Use Type Hints in order to perform static type checking with mypy:
def main() -> None:
pass
- Encapsulate code in a
main
function:
if __name__ == '__main__':
main()