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

Norminette bad indentation in global values with multi-line initialization #394

Open
astahjmo opened this issue Jun 25, 2023 · 1 comment
Labels
bug Something isn't working

Comments

@astahjmo
Copy link
Contributor

Describe the bug
The bug occurs when you try to initialize a global multiline variable as a two-dimensional array with tab

Erroneous code

int  g_test[3][2] = {
  {-3, 42},
  {42, 1},
  {-42, 0}
}

Additional infos

  • OS: Ubuntu 20.04 LTS
  • python --version: Python 3.8.10
  • norminette -v: <= 3.3.52

Additional context
The identation of global variables initialized in multi-dimensional arrays does not follow the identation of the entire file as expected with structs and enums
image
image

@NiumXp
Copy link
Contributor

NiumXp commented Jun 25, 2023

Occurs in other scopes as well:

void	main(void)
{
	static int	t[3][2] = {
		{1, 1},
		{2, 2},
		{3, 3},
	};
}
Error: INVALID_HEADER       (line:   1, col:   1):      Missing or invalid 42 header
Error: TOO_MANY_TAB         (line:   4, col:   1):      Extra tabs for indent level
Error: TOO_MANY_TAB         (line:   5, col:   1):      Extra tabs for indent level
Error: TOO_MANY_TAB         (line:   6, col:   1):      Extra tabs for indent level

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants