2015-02-20 15:22:44 +01:00
|
|
|
# Contributing
|
2014-05-26 21:26:52 +02:00
|
|
|
|
|
|
|
## Bugs
|
2014-05-24 22:13:42 +02:00
|
|
|
|
2015-06-14 02:35:10 +02:00
|
|
|
Please look at [Github Issues](https://github.com/awesomeWM/awesome/issues).
|
2014-05-24 22:13:42 +02:00
|
|
|
|
2014-05-26 21:26:52 +02:00
|
|
|
## Style
|
2014-05-24 22:13:42 +02:00
|
|
|
|
|
|
|
If you intend to patch and contribute to awesome, please respect the
|
|
|
|
following guidelines.
|
|
|
|
|
|
|
|
Imitate the existing code style. For concrete rules:
|
|
|
|
|
|
|
|
- Use 4 spaces indentation, do not use tabulator characters;
|
|
|
|
|
|
|
|
- Place braces alone on new lines, and do not place braces for single
|
2015-07-12 17:32:35 +02:00
|
|
|
line statement where it is not needed, i.e.:
|
2014-05-24 22:13:42 +02:00
|
|
|
|
2016-03-13 17:17:34 +01:00
|
|
|
if(foo)
|
|
|
|
x = 1;
|
|
|
|
|
|
|
|
if(foo)
|
|
|
|
{
|
|
|
|
x = 1;
|
|
|
|
bar();
|
|
|
|
}
|
2014-05-24 22:13:42 +02:00
|
|
|
|
|
|
|
- Do not put a space after if, for, while or function call statements;
|
|
|
|
|
2015-07-12 17:32:35 +02:00
|
|
|
- The preferred maximum line length is 80 characters;
|
2014-05-24 22:13:42 +02:00
|
|
|
|
|
|
|
- Use `/* */` for comments;
|
|
|
|
|
2015-07-12 17:32:35 +02:00
|
|
|
- Use the API: there is a list of `a_*()` functions you should use instead
|
2015-02-26 14:52:21 +01:00
|
|
|
of the standard libc ones. There is also a common API for linked lists,
|
2015-02-26 12:08:53 +01:00
|
|
|
tabulars, etc.;
|
2014-05-24 22:13:42 +02:00
|
|
|
|
|
|
|
- Be *clear* in what you do;
|
|
|
|
|
2015-07-12 17:32:35 +02:00
|
|
|
- Prefix your function names with the module they are enhancing,
|
|
|
|
i.e. if you add a function to manipulate a tag, prefix it with `tag_`;
|
2014-05-24 22:13:42 +02:00
|
|
|
|
|
|
|
- Write documentation for any new functions, options, whatever.
|
|
|
|
|
|
|
|
A vim modeline is set in each file to respect this.
|
|
|
|
|
2015-06-14 02:35:10 +02:00
|
|
|
### Documentation of Lua files
|
2015-02-26 12:09:17 +01:00
|
|
|
|
|
|
|
For documentation purposes LDoc---see
|
|
|
|
[here](https://stevedonovan.github.io/ldoc/manual/doc.md.html) for its
|
2015-02-26 14:52:21 +01:00
|
|
|
documentation---is used. Comments that shall be parsed by LDoc have the
|
|
|
|
following format:
|
2015-02-26 12:09:17 +01:00
|
|
|
|
|
|
|
--- summary.
|
|
|
|
-- Description; this can extend over
|
|
|
|
-- several lines
|
2015-02-26 14:52:21 +01:00
|
|
|
|
2015-02-26 12:09:17 +01:00
|
|
|
-----------------
|
|
|
|
-- This will also do.
|
2015-02-26 14:52:21 +01:00
|
|
|
|
2015-02-26 12:09:17 +01:00
|
|
|
--[[--
|
|
|
|
Summary. A description
|
|
|
|
...;
|
|
|
|
]]
|
|
|
|
|
2015-06-14 02:35:10 +02:00
|
|
|
You can use the full power of
|
2015-02-26 14:52:21 +01:00
|
|
|
[Markdown](http://daringfireball.net/projects/markdown) with the extensions of
|
2015-06-14 02:35:10 +02:00
|
|
|
[Discount](http://www.pell.portland.or.us/~orc/Code/discount/) for markup in
|
2015-02-26 14:52:21 +01:00
|
|
|
the comments.
|
2015-02-26 12:09:17 +01:00
|
|
|
|
|
|
|
Every module and class should have a short description at its beginning which
|
2016-10-09 22:36:20 +02:00
|
|
|
should include `@author author`, `@copyright year author` and
|
|
|
|
`@module module-name` or `@classmod class-name`.
|
2015-06-14 02:35:10 +02:00
|
|
|
|
|
|
|
Parameters of functions should be documented using
|
|
|
|
`@tparam <type> <parmname> <description>`, and return values via
|
|
|
|
`@treturn <type> <description>`.
|
|
|
|
|
|
|
|
For a more comprehensive description of the available tags see the [LDoc
|
2015-02-26 14:52:21 +01:00
|
|
|
documentation](https://stevedonovan.github.io/ldoc/manual/doc.md.html).
|
2015-02-26 12:09:17 +01:00
|
|
|
|
2015-02-26 14:52:21 +01:00
|
|
|
In addition to the regular tags provided by LDoc there are also some aliases
|
2015-06-14 02:35:10 +02:00
|
|
|
for typed parameters defined in `docs/config.ld`, e.g. `@client` for
|
2015-07-25 00:00:07 +02:00
|
|
|
`@tparam client.object`, `@tag` for `@tparam tag` and `@tab` for
|
2015-06-14 02:35:10 +02:00
|
|
|
`@tparam table`).
|
2015-02-26 12:09:17 +01:00
|
|
|
|
2014-05-26 21:26:52 +02:00
|
|
|
## Patches
|
2014-05-24 22:13:42 +02:00
|
|
|
|
|
|
|
If you plan to submit patches, you should follow the following guidelines.
|
|
|
|
|
2014-05-26 21:26:52 +02:00
|
|
|
### Commits
|
2014-05-24 22:13:42 +02:00
|
|
|
|
|
|
|
- make commits of logical units;
|
|
|
|
- do not modify piece of code not related to your commit;
|
|
|
|
- do not try to fix style of code you are not writing,
|
|
|
|
it's just adding noise for no gain;
|
2015-02-26 12:08:53 +01:00
|
|
|
- check for unnecessary whitespace with `git diff --check` before committing;
|
2014-05-24 22:13:42 +02:00
|
|
|
- do not check in commented out code or unneeded files;
|
|
|
|
- provide a meaningful commit message;
|
|
|
|
- the first line of the commit message should be a short;
|
|
|
|
description and should skip the full stop;
|
|
|
|
- if you want your work included, add a
|
2015-02-26 17:05:54 +01:00
|
|
|
`Signed-off-by: Your Name <you@example.com>` line to the
|
2015-02-26 12:08:53 +01:00
|
|
|
commit message (or just use the option `-s` when committing);
|
2015-02-26 14:52:21 +01:00
|
|
|
- make sure that you have tests for the bug you are fixing;
|
2015-02-20 15:22:44 +01:00
|
|
|
- if possible, add a unit test to the test suite under spec/.
|
2014-05-24 22:13:42 +02:00
|
|
|
|
2014-05-26 21:26:52 +02:00
|
|
|
### Patches
|
2014-05-24 22:13:42 +02:00
|
|
|
|
2015-02-26 14:52:45 +01:00
|
|
|
Submitting patches via pull requests on the Github project is the preferred
|
|
|
|
method.
|
|
|
|
|
|
|
|
#### Pull request
|
|
|
|
- create a [pull request](https://github.com/awesomeWM/awesome/pulls)
|
|
|
|
|