Beakerboy / VBA-Linter

Lint VBA code
MIT License
6 stars 1 forks source link

vba_linter:0.4 and antlr4_vba:0.0.62 compatability #96

Closed tfindlay-au closed 5 months ago

tfindlay-au commented 5 months ago

Possible version compatibility issue with vba_linter 0.4 and antlr4_vba 0.0.62

(venv) PS C:\Users\username\IdeaProjects\pdu_configurator> python -m vba_linter ./src
Traceback (most recent call last):
  File "<frozen runpy>", line 198, in _run_module_as_main
  File "<frozen runpy>", line 88, in _run_code
  File "C:\Users\username\IdeaProjects\my_project\venv\Lib\site-packages\vba_linter\__main__.py", line 53, in <module>
    main()
  File "C:\Users\username\IdeaProjects\my_project\venv\Lib\site-packages\vba_linter\__main__.py", line 22, in main
    dir.load_all_rules()
  File "C:\Users\username\IdeaProjects\my_project\venv\Lib\site-packages\vba_linter\rule_directory.py", line 38, in load_all_rules
    vbaLexer.WS, vbaLexer.T__0,
                 ^^^^^^^^^^^^^
AttributeError: type object 'vbaLexer' has no attribute 'T__0'

May need to version lock the dependency or just deprecate the properties for backward compatability.

For reference, pip installed them as follows:

Name: antlr4_vba Version: 0.0.62 Summary: VBA targeted antlr4 parsing classes. Home-page: Author: Author-email: Kevin Nowaczyk beakerboy99@yahoo.com License: Location: C:\Users\username\IdeaProjects\my_project\venv\Lib\site-packages Requires: antlr4-python3-runtime, antlr4-tools Required-by: vba-linter

Name: vba-linter Version: 0.0.4 Summary: Lint VBA code. Home-page: Author: Author-email: Kevin Nowaczyk beakerboy99@yahoo.com License: Location: C:\Users\username\IdeaProjects\my_project\venv\Lib\site-packages Requires: antlr4-python3-runtime, antlr4-tools, antlr4-vba, PyYAML Required-by:

Beakerboy commented 5 months ago

You are correct, there must be a version lock that is required here. The T0 token is a comma, so changing vbaLexer.T0 to vbaLexer.COMMA may also fix it.

Beakerboy commented 5 months ago

I’ve identified a version of antlr4_VBA for which the main branch runs without error. I’d suggest testing the dev branch as welll since that’s where things will be heading. Since this is just a hobby project, I can’t guarantee that I’ll be working on it again any time soon.