Beakerboy / VBA-Linter

Lint VBA code
MIT License
6 stars 1 forks source link

AttributeError: 'W201' object has no attribute '_message' #55

Closed DecimalTurn closed 10 months ago

DecimalTurn commented 10 months ago

I tried running the linter on this repo, but I go the following error:

Run python -m vba_linter $FULLPATH
Traceback (most recent call last):
  File "/usr/lib/python3.10/runpy.py", line 196, in _run_module_as_main
    return _run_code(code, main_globals, None,
  File "/usr/lib/python3.10/runpy.py", line 86, in _run_code
    exec(code, run_globals)
  File "/home/runner/.local/lib/python3.10/site-packages/vba_linter/__main__.py", line 53, in <module>
    main()
  File "/home/runner/.local/lib/python3.10/site-packages/vba_linter/__main__.py", line [29](https://github.com/DecimalTurn/Excel-Pomodoro-Timer/actions/runs/7280016020/job/19837537163#step:3:32), in main
    msg = dir.get_rule(error[2]).create_message(error)
  File "/home/runner/.local/lib/python3.10/site-packages/vba_linter/rules/rule_base.py", line 19, in create_message
    return (":%s:%s: %s " + self._message) % data
AttributeError: 'W201' object has no attribute '_message'

See details here.

Beakerboy commented 10 months ago

Would you be able to test the dev branch to see if this resolves your problem? It turns out I was both missing the attribute and somehow missed testing the message. I added the test and added the attribute.

DecimalTurn commented 10 months ago

Seems to have worked.