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

AttributeError: 'NoneType' object has no attribute 'type' #522

Open
baschni opened this issue Dec 25, 2024 · 0 comments
Open

AttributeError: 'NoneType' object has no attribute 'type' #522

baschni opened this issue Dec 25, 2024 · 0 comments

Comments

@baschni
Copy link

baschni commented Dec 25, 2024

Running norminette on a .h file with one line content

int a(int b)

yields the following error:

Traceback (most recent call last):
  File "/home/baschnit/.local/bin/norminette", line 8, in <module>
    sys.exit(main())
             ^^^^^^
  File "/home/baschnit/.local/pipx/venvs/norminette/lib/python3.11/site-packages/norminette/__main__.py", line 155, in main
    registry.run(context, source)
  File "/home/baschnit/.local/pipx/venvs/norminette/lib/python3.11/site-packages/norminette/registry.py", line 61, in run
    ret, jump = self.run_rules(context, rule)
                ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/baschnit/.local/pipx/venvs/norminette/lib/python3.11/site-packages/norminette/registry.py", line 29, in run_rules
    result = rule.run(context)
             ^^^^^^^^^^^^^^^^^
  File "/home/baschnit/.local/pipx/venvs/norminette/lib/python3.11/site-packages/norminette/rules/is_func_prototype.py", line 200, in run
    ret, read = self.check_func_format(context)
                ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/baschnit/.local/pipx/venvs/norminette/lib/python3.11/site-packages/norminette/rules/is_func_prototype.py", line 181, in check_func_format
    i = context.skip_nest(i)
        ^^^^^^^^^^^^^^^^^^^^
  File "/home/baschnit/.local/pipx/venvs/norminette/lib/python3.11/site-packages/norminette/context.py", line 370, in skip_nest
    c = self.peek_token(pos).type
        ^^^^^^^^^^^^^^^^^^^^^^^^^
AttributeError: 'NoneType' object has no attribute 'type'

using norminette 3.3.55

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

No branches or pull requests

1 participant