-
Notifications
You must be signed in to change notification settings - Fork 2.3k
Clean up 10 theme files and expand linting coverage #2334
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
seefood
wants to merge
7
commits into
master
Choose a base branch
from
ira/theme-cleanup-expansion
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
7 commits
Select commit
Hold shift + click to select a range
457c106
Fixes by the pre-commit checks
seefood f0908c8
even more Fixes by the pre-commit checks
seefood 10713d5
Get rid of shellcheck disable=SC2046
seefood a9f7b45
Merge branch 'master' into ira/autosave-history-plml
seefood dd53b0a
Clean up 5 theme files and expand linting coverage
seefood 8c16714
Clean up 5 additional theme files and expand linting coverage
seefood 8823ab6
Update themes/modern-t/modern-t.theme.bash
seefood File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,28 +1,33 @@ | ||
# shellcheck shell=bash | ||
# shellcheck disable=SC2034 | ||
# ------------------------------------------------------------------# | ||
# FILE: mbriggs.zsh-theme # | ||
# BY: Matt Briggs ([email protected]) # | ||
# BASED ON: smt by Stephen Tudor ([email protected]) # | ||
# ------------------------------------------------------------------# | ||
|
||
SCM_THEME_PROMPT_DIRTY="${red}⚡${reset_color}" | ||
SCM_THEME_PROMPT_AHEAD="${red}!${reset_color}" | ||
SCM_THEME_PROMPT_CLEAN="${green}✓${reset_color}" | ||
SCM_THEME_PROMPT_DIRTY="${red?}⚡${reset_color?}" | ||
SCM_THEME_PROMPT_AHEAD="${red?}!${reset_color?}" | ||
SCM_THEME_PROMPT_CLEAN="${green?}✓${reset_color?}" | ||
SCM_THEME_PROMPT_PREFIX=" " | ||
SCM_THEME_PROMPT_SUFFIX="" | ||
GIT_SHA_PREFIX=" ${yellow}" | ||
GIT_SHA_SUFFIX="${reset_color}" | ||
GIT_SHA_PREFIX=" ${yellow?}" | ||
GIT_SHA_SUFFIX="${reset_color?}" | ||
|
||
function git_short_sha() { | ||
SHA=$(git rev-parse --short HEAD 2> /dev/null) && echo "$GIT_SHA_PREFIX$SHA$GIT_SHA_SUFFIX" | ||
} | ||
|
||
function prompt() { | ||
local return_status="" | ||
local ruby="${red}$(ruby_version_prompt)${reset_color}" | ||
local user_host="${green}\h${reset_color}" | ||
local ruby | ||
ruby="${red?}$(ruby_version_prompt)${reset_color?}" | ||
local user_host | ||
user_host="${green?}\h${reset_color?}" | ||
local current_path="\w" | ||
local n_commands="\!" | ||
local git_branch="$(git_short_sha)$(scm_prompt_info)" | ||
local git_branch | ||
git_branch="$(git_short_sha)$(scm_prompt_info)" | ||
local prompt_symbol='λ' | ||
local open='(' | ||
local close=')' | ||
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,12 +1,13 @@ | ||
#!/usr/bin/env bash | ||
# shellcheck shell=bash | ||
# shellcheck disable=SC2034 | ||
|
||
SCM_THEME_PROMPT_PREFIX="${cyan}(${green}" | ||
SCM_THEME_PROMPT_SUFFIX="${cyan})" | ||
SCM_THEME_PROMPT_DIRTY=" ${red}✗" | ||
SCM_THEME_PROMPT_CLEAN=" ${green}✓" | ||
SCM_THEME_PROMPT_PREFIX="${cyan?}(${green?}" | ||
SCM_THEME_PROMPT_SUFFIX="${cyan?})" | ||
SCM_THEME_PROMPT_DIRTY=" ${red?}✗" | ||
SCM_THEME_PROMPT_CLEAN=" ${green?}✓" | ||
|
||
prompt() { | ||
PS1="$(scm_prompt_info)${reset_color} ${cyan}\W${reset_color} " | ||
PS1="$(scm_prompt_info)${reset_color?} ${cyan?}\W${reset_color?} " | ||
} | ||
|
||
safe_append_prompt_command prompt |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change | ||||||
---|---|---|---|---|---|---|---|---|
@@ -1,14 +1,16 @@ | ||||||||
# shellcheck shell=bash | ||||||||
# shellcheck disable=SC2034 | ||||||||
# Modified version of the original modern theme in bash-it | ||||||||
# Removes the battery charge and adds the current time | ||||||||
|
||||||||
SCM_THEME_PROMPT_PREFIX="" | ||||||||
SCM_THEME_PROMPT_SUFFIX="" | ||||||||
|
||||||||
SCM_THEME_PROMPT_DIRTY=" ${bold_red}✗${normal}" | ||||||||
SCM_THEME_PROMPT_CLEAN=" ${bold_green}✓${normal}" | ||||||||
SCM_GIT_CHAR="${bold_green}±${normal}" | ||||||||
SCM_SVN_CHAR="${bold_cyan}⑆${normal}" | ||||||||
SCM_HG_CHAR="${bold_red}☿${normal}" | ||||||||
SCM_THEME_PROMPT_DIRTY=" ${bold_red?}✗${normal?}" | ||||||||
SCM_THEME_PROMPT_CLEAN=" ${bold_green?}✓${normal?}" | ||||||||
SCM_GIT_CHAR="${bold_green?}±${normal?}" | ||||||||
SCM_SVN_CHAR="${bold_cyan?}⑆${normal?}" | ||||||||
SCM_HG_CHAR="${bold_red?}☿${normal?}" | ||||||||
|
||||||||
case $TERM in | ||||||||
xterm*) | ||||||||
|
@@ -22,8 +24,8 @@ esac | |||||||
PS3=">> " | ||||||||
|
||||||||
is_vim_shell() { | ||||||||
if [ ! -z "$VIMRUNTIME" ]; then | ||||||||
echo "[${cyan}vim shell${normal}]" | ||||||||
if [ -n "$VIMRUNTIME" ]; then | ||||||||
echo "[${cyan?}vim shell${normal?}]" | ||||||||
fi | ||||||||
} | ||||||||
|
||||||||
|
@@ -33,14 +35,15 @@ modern_current_time_prompt() { | |||||||
|
||||||||
prompt() { | ||||||||
SCM_PROMPT_FORMAT='[%s][%s]' | ||||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
|
||||||||
if [ $? -ne 0 ]; then | ||||||||
local last_status=$? | ||||||||
if [ $last_status -ne 0 ]; then | ||||||||
Comment on lines
+38
to
+39
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
|
||||||||
# Yes, the indenting on these is weird, but it has to be like | ||||||||
# this otherwise it won't display properly. | ||||||||
|
||||||||
PS1="${TITLEBAR}${bold_red}┌─${reset_color}$(scm_prompt)$(modern_current_time_prompt)[${cyan}\W${normal}]$(is_vim_shell) | ||||||||
${bold_red}└─▪${normal} " | ||||||||
PS1="${TITLEBAR}${bold_red?}┌─${reset_color?}$(scm_prompt)$(modern_current_time_prompt)[${cyan?}\W${normal?}]$(is_vim_shell) | ||||||||
${bold_red?}└─▪${normal?} " | ||||||||
else | ||||||||
PS1="${TITLEBAR}┌─$(scm_prompt)$(modern_current_time_prompt)[${cyan}\W${normal}]$(is_vim_shell) | ||||||||
PS1="${TITLEBAR}┌─$(scm_prompt)$(modern_current_time_prompt)[${cyan?}\W${normal?}]$(is_vim_shell) | ||||||||
└─▪ " | ||||||||
fi | ||||||||
} | ||||||||
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is this needed? When the right-hand side contains command substitutions
$(...)
, Shellcheck will complain that the exit status of the command is masked. However, this line doesn't contain any command substitutions.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
but shellcheck did complain. you prefer I disable a few more checks?
Uh oh!
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What kind of error does Shellcheck produce?
I tried it in my environments, but Shellcheck doesn't complain about this. Which version of Shellcheck do you use?
In another host,