-
Notifications
You must be signed in to change notification settings - Fork 86
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
Adding HACKING.md #111
base: master
Are you sure you want to change the base?
Adding HACKING.md #111
Conversation
docs/HACKING.md
Outdated
@@ -0,0 +1,192 @@ | |||
CodeBase Workflow |
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.
CodeBase Workflow | |
HACKING |
docs/HACKING.md
Outdated
CodeBase Workflow | ||
======== | ||
|
||
Report on the working of the code base. It contains the details of file execution and feature implementations in stages. |
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.
Report on the working of the code base. It contains the details of file execution and feature implementations in stages. | |
This file contains the details of the program's execution in stages. |
docs/HACKING.md
Outdated
|
||
Report on the working of the code base. It contains the details of file execution and feature implementations in stages. | ||
|
||
## First Stage: Command line execution |
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.
## First Stage: Command line execution | |
## Arguments parsing and loading |
docs/HACKING.md
Outdated
|
||
## First Stage: Command line execution | ||
|
||
* To format a file user use the command line: |
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.
* To format a file user use the command line: | |
The user invokes the program as the following: |
docs/HACKING.md
Outdated
|
||
* To format a file user use the command line: | ||
|
||
* `lua-format {lua script} {options}` |
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.
* `lua-format {lua script} {options}` | |
`lua-format [options] <scripts>` |
docs/HACKING.md
Outdated
|
||
* Similarly, with rest option, In ‘config’ or ‘c’ option, `args::ValueFlag<string> cFile` | ||
|
||
* This will read the argument and take the name value of the config file. |
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.
* This will read the argument and take the name value of the config file. |
docs/HACKING.md
Outdated
|
||
* This will read the argument and take the name value of the config file. | ||
|
||
* Now read the ConfiFileName by `args::get(cFile);` |
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.
* Now read the ConfiFileName by `args::get(cFile);` | |
Now the program reads the configuration files. There are a couple of _known_ locations the program will check for configuration files, if **no** file is specified in the command line. | |
In order of search: | |
* Linux: `./.lua-format`, `$XDG_CONFIG_HOME/luaformatter/config.yaml`, `$HOME/.config/luaformatter/config.yaml` | |
* Windows: `./.lua-format` | |
* OSX: `./.lua-format` | |
docs/HACKING.md
Outdated
|
||
* Now read the ConfiFileName by `args::get(cFile);` | ||
|
||
* After that check whether to use default config or the configfile given by the user. |
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.
* After that check whether to use default config or the configfile given by the user. | |
In case it doesn't find any suitable file it will fallback to the default values. | |
The default values are hard coded in the program (`Config.cpp`) and are used as fallback whenever possible. For instance when fields are not specified in the user's configuration file. |
docs/HACKING.md
Outdated
|
||
* After that check whether to use default config or the configfile given by the user. | ||
|
||
* If the configfile name is empty then the default configuration will be enabled. |
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.
* If the configfile name is empty then the default configuration will be enabled. |
docs/HACKING.md
Outdated
|
||
* If the configfile name is empty then the default configuration will be enabled. | ||
|
||
* If the config file exists then all the configuration in the file is obtained and set the config value for the formatter. |
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.
* If the config file exists then all the configuration in the file is obtained and set the config value for the formatter. |
e1b64a1
to
3206636
Compare
5d65d04
to
bccbc58
Compare
It contains the report on how the codebase works to guide the other developers.