aboutsummaryrefslogtreecommitdiff
path: root/src/clint.py
Commit message (Collapse)AuthorAge
...
* Merge pull request #5863 from ZyX-I/more-clint-checksJames McCoy2017-01-10
|\ | | | | More clint brace checks
| * clint: Check for misplaced brace at function startZyX2017-01-03
| |
| * clint: Enable check for `{` positioned at the start of the line correctlyZyX2017-01-03
| | | | | | | | For some reason that was incorrectly hidden by “file is *not* \*.c or \*.h file” check.
* | Merge #5079 from ZyX-I/shada-save-current-posJustin M. Keyes2017-01-07
|\ \ | | | | | | shada: Save current cursor position before saving jumps
| * | clint: Add more exceptions to “space after a cast” ruleZyX2017-01-06
| |/ | | | | | | Python does not allow branching here, complaining that look-behind is not fixed-width.
* / clint: Allow including .c.h files multiple timesZyX2017-01-03
|/ | | | | Except when they are system just in case. There should be no .c.h system files though, but if there will be it is unlikely that they inherit the same convention.
* *: Fix linter errorsZyX2016-06-24
| | | | | | | | | Also adds one exception to linter rules: typedef struct { kvec_t(Object) stack; } EncodedData; is completely valid (from the style guide point of view) code.
* clint: Add rules that forbids spaces after a cast operatorZyX2016-06-11
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | https://neovim.io/develop/style-guide.xml#Horizontal_Whitespace Note that this errors out for e.g. if (has_mbyte) mb_copy_char((const char_u **)(&f), &t); \ (found in macros.h:151) or #define ECMD_SET_HELP 0x02 /* set b_help flag of (new) buffer before (found in ex_cmds.h:11) (note `(new) buffer`). I left this as-is because these pieces of code are already caught by another rule (braces near if and `/*`-style comments). Other false positives I found were: 1. `FUNC_ATTR_NONNULL_ARG(1) FUNC_ATTR_WARN_UNUSED_RESULT`: rejected by requiring type name to start with `[a-zA-Z_]` (this makes `1` not be incorrectly recognized as a type). 2. `#define FOO(var) (var)`: rejected by creating `cast_line`. 3. `(expr) * (expr)`: rejected by constructing regexp so that unary operators require no spaces after them. 4. `int f(void) FUNC_ATTR_PURE`: rejected by requiring line to start with a space. 5. `"." STR(NVIM_VERSION_PATCH) NVIM_VERSION_PRERELEASE`: not rejected, such thing should be rare and it would be easy to get rid of the false positive by e.g. breaking line. Struct literals like `(MyStruct) { 4, 2 }` are not checked: 1. I am not sure whether they are under this rule at all (this is not a cast). 2. It would be hard to get rid of false positives (like the example with `if` above, but now for *valid* `if() {}`s).
* clint: Reject indented preprocessor directivesZyX2016-06-11
| | | | | This is also not allowed by the style guide: https://neovim.io/develop/style-guide.xml#Preprocessor_Directives.
* clint: Do not allow aligning line continuation charactersZyX2016-06-11
| | | | | | | Rejected by https://neovim.io/develop/style-guide.xml#Horizontal_Whitespace. Note: what to do with “empty” lines is not described in the style guide, neither it is checked.
* reorgJustin M. Keyes2016-06-03