Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
N
neofetch
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Ximper Linux
neofetch
Commits
1a3c8638
Commit
1a3c8638
authored
May 04, 2018
by
Dylan Araps
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
docs: update
parent
ffd711a4
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
12 additions
and
10 deletions
+12
-10
CONTRIBUTING.md
CONTRIBUTING.md
+12
-10
No files found.
CONTRIBUTING.md
View file @
1a3c8638
...
...
@@ -41,6 +41,8 @@ request on the repo and our Travis.ci hook will run ShellCheck for you.
## No no's
-
Don’t use
`echo`
.
-
Use
`printf "%s\n"`
-
Don’t use
`bc`
.
-
Don’t use
`sed`
.
-
Use
`bash`
's built-in
[
parameter expansion
](
http://wiki.bash-hackers.org/syntax/pe
)
.
...
...
@@ -52,21 +54,21 @@ request on the repo and our Travis.ci hook will run ShellCheck for you.
## If Statements
If the test only has one command inside of it; use the compact
`if`
If the test only has one command inside of it; use the compact
test
syntax. Otherwise the normal
`if`
/
`fi`
is just fine.
```
sh
# Bad
if
[[
"
$var
"
]]
;
then
echo
"
$var
"
printf
"%s
\n
"
"
$var
"
fi
# Good
[[
"
$var
"
]]
&&
echo
"
$var
"
[[
"
$var
"
]]
&&
printf
"%s
\n
"
"
$var
"
# Also good (Use this for longer lines).
[[
"
$var
"
]]
&&
\
echo
"
$var
"
printf
"%s
\n
"
"
$var
"
```
...
...
@@ -77,16 +79,16 @@ Case statements need to be formatted in a specific way.
```
sh
# Good example (Notice the indentation).
case
"
$var
"
in
1
)
echo
1
;;
1
)
printf
"%s
\n
"
1
;;
2
)
echo
1
echo
2
printf
"%s
\n
"
"1"
printf
"%s
\n
"
"2"
;;
*
)
echo
1
echo
2
echo
3
printf
"%s
\n
"
"1"
printf
"%s
\n
"
"2"
printf
"%s
\n
"
"3"
;;
esac
```
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment