Skip to content
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

Open
wants to merge 4 commits into
base: master
Choose a base branch
from
Open

Adding HACKING.md #111

wants to merge 4 commits into from

Conversation

karanankit01
Copy link
Contributor

It contains the report on how the codebase works to guide the other developers.

docs/HACKING.md Outdated
@@ -0,0 +1,192 @@
CodeBase Workflow
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
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.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
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
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
## 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:
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
* 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}`
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
* `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.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
* 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);`
Copy link
Contributor

@tammela tammela May 24, 2020

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
* 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.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
* 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.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
* 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.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
* If the config file exists then all the configuration in the file is obtained and set the config value for the formatter.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants