Minor tweaks to the rules.
parent
c05a93e306
commit
d2e034defe
|
@ -1,10 +1,11 @@
|
|||
These are the code style guidelines that should be followed when contributing to fluxion.
|
||||
|
||||
## Indentation
|
||||
_Indent = two tabs
|
||||
<br>
|
||||
<br>
|
||||
Not hard tabs. Not four spaces. Not however many spaces you feel like. **2 tabs.**
|
||||
Due to the fact the tab length may vary between systems and users, use **two spaces** instead of real tabs.
|
||||
* No hard tabs (\t)
|
||||
* Not four spaces
|
||||
* Not however many spaces you feel like
|
||||
* **Two spaces** ( )
|
||||
|
||||
## Line Length
|
||||
Be reasonable. Keeping within 80 characters is recommended, 120 is the **maximum**.
|
||||
|
@ -21,19 +22,17 @@ This function is prefixed with "fluxion" to signify it belongs to the fluxion sc
|
|||
|
||||
## Variables
|
||||
* Limit the scope of variables to local if within a function.
|
||||
* Wrap your variables in ${curly} ${braces} for clarity.
|
||||
* Use existing variables whenever possible to avoid pollution.
|
||||
* Identify variables using **camel-case**.
|
||||
* Prefix identifiers with the **capitalized** script name defining them.
|
||||
|
||||
For example, the global "FluxionLanguage"
|
||||
For example, the global "CaptivePortalHashPath"
|
||||
|
||||
This global is prefixed with "Fluxion" to signify it belongs to the fluxion script. Using camel-case makes it clear it's not a subroutine.
|
||||
This global is prefixed with "CaptivePortal" to signify it belongs to the captive portal attack script. Using camel-case makes it clear it's not a subroutine, which use **snake-case**.
|
||||
|
||||
|
||||
## Constants
|
||||
* Limit the scope of constants to local if within a function.
|
||||
* Wrap your constants in ${curly} ${braces} for clarity.
|
||||
* Use existing constants whenever possible to avoid pollution.
|
||||
* Identify constants using **camel-case**.
|
||||
* Prefix identifiers with the **uppercased** script name defining them.
|
||||
|
@ -54,6 +53,9 @@ $(whoami)
|
|||
```
|
||||
${USER}
|
||||
${PWD}
|
||||
|
||||
$USER
|
||||
$PWD
|
||||
```
|
||||
|
||||
## Flow Logic
|
||||
|
@ -81,7 +83,7 @@ foo() {
|
|||
print 'bar'
|
||||
}
|
||||
```
|
||||
NOTE: There are some exceptions but in general use POSIX.
|
||||
NOTE: There are some exceptions but in general use POSIX standards.
|
||||
|
||||
## Misc
|
||||
Do NOT use backticks (\`command\`) to execute something in a subshell.
|
||||
|
|
Loading…
Reference in New Issue