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
Indent rules from clint.py are inconsistent #17763
Comments
Hmm, this entry in Line 1052 in 233014f
does not match this: neovim/runtime/doc/dev_style.txt Line 868 in 233014f
|
If we set |
Oh... |
Hardcoding the exact alignment of inner expression is probably the single most disruptive style rule of neovim. I've had to sacrifice all formatting of ternary operators in order to satisfy this rule. |
@dundargoc, semi related, would it be possible to either update or lock
this is what I'm using $ uncrustify --version
Uncrustify-0.74.0-203-9bdb790e0 and this is the rule Line 1 in d7cbb07
I think these rules are "tuneable" as of late. |
The uncrustify config is "locked" to 0.74, the latest stable. You can update the config file to a newer uncrustify version by using
This will update the uncrustify config to a newer version using the options from the old uncrustify config. |
thanks for the clarification! I was wondering what the "update" part meant, since I've been basically running this to generate a new file and then merge them manually uncrustify --update-config-with-doc -o src/uncrustify_new.cfg even the help output is misleading... $ uncrustify --help
...
Config/Help Options:
-h -? --help --usage : Print this message and exit.
--version : Print the version and exit.
--count-options : Print the number of available options and exit.
--show-config : Print out option documentation and exit.
--update-config : Output a new config file. Use with -o FILE.
--update-config-with-doc : Output a new config file. Use with -o FILE.
--universalindent : Output a config file for Universal Indent GUI.
--detect : Detects the config from a source file. Use with '-f FILE'.
Detection is fairly limited.
--set <option>=<value> : Sets a new value to a config option.
... |
Personally I'd be in favor of relaxing this, if it significantly helps us automate formatting & linting. @bfredl @jamessan ? |
Yes. I think it is a good default, but we don't need to strictly enforce it. |
Uncrustify is the source of truth where possible. Remove any redundant checks from clint.py. See also neovim#18563 Closes neovim#17763
Uncrustify is the source of truth where possible. Remove any redundant checks from clint.py. See also neovim#18563 Closes neovim#17763
Uncrustify is the source of truth where possible. Remove any redundant checks from clint.py. See also neovim#18563 Closes neovim#17763
Uncrustify is the source of truth where possible. Remove any redundant checks from clint.py. See also neovim#18563 Closes neovim#17763
Uncrustify is the source of truth where possible. Remove any redundant checks from clint.py. See also neovim#18563 Closes neovim#17763
Uncrustify is the source of truth where possible. Remove any redundant checks from clint.py. See also neovim#18563 Closes neovim#17763
…8611 Uncrustify is the source of truth where possible. Remove any redundant checks from clint.py. See also neovim#18563 Closes neovim#17763
…8611 Uncrustify is the source of truth where possible. Remove any redundant checks from clint.py. See also neovim#18563 Closes neovim#17763
Feature already in Vim?
NA
Feature description
The
whitespace/indent
rules specifically appear to be either broken or mis-configuredneovim/src/clint.py
Lines 2915 to 2921 in 3830960
why would the inner expression indentation be set (hard-coded) to
4
when the global indentation is2
?neovim/src/clint.py
Lines 2118 to 2123 in 3830960
Example
src/nvim/shada.c:3319: Weird number of spaces at line-start. Are you using a 2-space indent? [whitespace/indent] [3]
while adding two extra spaces for each line fixes it
Neither
clang-format
noruncrustify
is able to consistently keep up with this, at least I wasn't able to configure them, so we end up alternating between the two tools for each error, with a mixture of manual editing and trial and error to get around this.The text was updated successfully, but these errors were encountered: