feat: enhance code quality for project files
This commit is contained in:
parent
ac56569ba6
commit
48c8dcb2b6
4 changed files with 64 additions and 14 deletions
|
@ -19,3 +19,19 @@ trim_trailing_whitespace = false
|
||||||
# windows shell scripts
|
# windows shell scripts
|
||||||
[*.{cmd,bat,ps1}]
|
[*.{cmd,bat,ps1}]
|
||||||
end_of_line = crlf
|
end_of_line = crlf
|
||||||
|
|
||||||
|
[*.sh]
|
||||||
|
indent_style = space
|
||||||
|
indent_size = 4
|
||||||
|
|
||||||
|
shell_variant = posix # like -ln=posix
|
||||||
|
binary_next_line = true # like -bn
|
||||||
|
switch_case_indent = true # like -ci
|
||||||
|
space_redirects = true # like -sr
|
||||||
|
keep_padding = true # like -kp
|
||||||
|
function_next_line = true # like -fn
|
||||||
|
never_split = true # like -ns
|
||||||
|
|
||||||
|
[Makefile]
|
||||||
|
indent_style = tab
|
||||||
|
indent_size = 8
|
||||||
|
|
4
Makefile
Normal file
4
Makefile
Normal file
|
@ -0,0 +1,4 @@
|
||||||
|
.PHONY: check-scripts
|
||||||
|
check-scripts:
|
||||||
|
# Fail if any of these files have warnings
|
||||||
|
shellcheck ./gruvbox-tmp.tmux
|
30
README.md
30
README.md
|
@ -54,6 +54,36 @@ set -g @tmux-gruvbox 'dark' # or 'light', 'dark-transparent', 'light-transparent
|
||||||
|
|
||||||
Hit `prefix + I` to fetch the plugin and source it. Your Tmux should be updated with the theme at this point.
|
Hit `prefix + I` to fetch the plugin and source it. Your Tmux should be updated with the theme at this point.
|
||||||
|
|
||||||
|
## Development
|
||||||
|
|
||||||
|
To run project locally pull the repo to desired place
|
||||||
|
|
||||||
|
```bash
|
||||||
|
cd $HOME/privatespace/
|
||||||
|
git clone ...
|
||||||
|
```
|
||||||
|
|
||||||
|
and in `~/.tmux.conf` set
|
||||||
|
|
||||||
|
```bash
|
||||||
|
# cd to tmux plugin directory
|
||||||
|
cd ~/.tmux/plugins/
|
||||||
|
|
||||||
|
# create simlink to
|
||||||
|
ln -sf $HOME/privatespace/tmux-gruvbox/ tmux-gruvbox
|
||||||
|
|
||||||
|
# set desired options...
|
||||||
|
set -g @tmux-gruvbox 'dark-transparent'
|
||||||
|
```
|
||||||
|
|
||||||
|
### Linters & formatters
|
||||||
|
|
||||||
|
To keep the files clean we use few program to help us achieve it:
|
||||||
|
|
||||||
|
1. Editorconfig (make sure your editor have it)
|
||||||
|
2. Markdown (prettier/prettierd)
|
||||||
|
3. Shell (shellcheck, shfmt)
|
||||||
|
|
||||||
## License
|
## License
|
||||||
|
|
||||||
GPLv3 - Maciej Sypień
|
GPLv3 - Maciej Sypień
|
||||||
|
|
|
@ -1,27 +1,27 @@
|
||||||
#!/usr/bin/env bash
|
#!/usr/bin/env bash
|
||||||
|
|
||||||
CURRENT_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
|
CURRENT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
|
||||||
THEME_OPTION="@tmux-gruvbox"
|
THEME_OPTION="@tmux-gruvbox"
|
||||||
DEFAULT_THEME="dark"
|
DEFAULT_THEME="dark"
|
||||||
|
|
||||||
get_theme() {
|
get_theme() {
|
||||||
local option="$1"
|
local option="$1"
|
||||||
local default_value="$2"
|
local default_value="$2"
|
||||||
local option_value
|
local option_value
|
||||||
option_value=$(tmux show-option -gqv "$option")
|
option_value=$(tmux show-option -gqv "$option")
|
||||||
if [ -z "$option_value" ]; then
|
if [ -z "$option_value" ]; then
|
||||||
echo "$default_value"
|
echo "$default_value"
|
||||||
else
|
else
|
||||||
echo "$option_value"
|
echo "$option_value"
|
||||||
fi
|
fi
|
||||||
}
|
}
|
||||||
|
|
||||||
main() {
|
main() {
|
||||||
local theme
|
local theme
|
||||||
theme=$(get_theme "$THEME_OPTION" "$DEFAULT_THEME")
|
theme=$(get_theme "$THEME_OPTION" "$DEFAULT_THEME")
|
||||||
tmux source-file "$CURRENT_DIR/tmux-gruvbox-${theme}.conf"
|
tmux source-file "$CURRENT_DIR/tmux-gruvbox-${theme}.conf"
|
||||||
}
|
}
|
||||||
|
|
||||||
main
|
main "$@"
|
||||||
|
|
||||||
# vi: ft=bash
|
# vi: ft=bash
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue