Closed sancarn closed 6 months ago
The main branch is out of date. Just use dev for the time being. I’m still finding omissions in the Microsoft documentation, reporting them to the company and figuring out how to handle them in the ANTLR grammar
Hmm odd, I was using dev before but was getting install errors:
Defaulting to user installation because normal site-packages is not writeable
Requirement already satisfied: pip in /usr/lib/python3/dist-packages (22.0.2)
Collecting pip
Downloading pip-24.0-py3-none-any.whl (2.1 MB)
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 2.1/2.1 MB 17.2 MB/s eta 0:00:00
Installing collected packages: pip
Successfully installed pip-24.0
Defaulting to user installation because normal site-packages is not writeable
Collecting vba_precompiler@ git+https://github.com/Beakerboy/VBA-Precompiler@dev
Cloning https://github.com/Beakerboy/VBA-Precompiler (to revision dev) to /tmp/pip-install-ycrfu8_e/vba-precompiler_3b[6](https://github.com/sancarn/stdVBA/actions/runs/8010322335/job/21881033889#step:3:7)8[7](https://github.com/sancarn/stdVBA/actions/runs/8010322335/job/21881033889#step:3:8)1659[8](https://github.com/sancarn/stdVBA/actions/runs/8010322335/job/21881033889#step:3:9)2044d8b3b22b6a2fe0cd[9](https://github.com/sancarn/stdVBA/actions/runs/8010322335/job/21881033889#step:3:10)a
Running command git clone --filter=blob:none --quiet https://github.com/Beakerboy/VBA-Precompiler /tmp/pip-install-ycrfu8_e/vba-precompiler_3b687[16](https://github.com/sancarn/stdVBA/actions/runs/8010322335/job/21881033889#step:3:17)598[20](https://github.com/sancarn/stdVBA/actions/runs/8010322335/job/21881033889#step:3:21)44d8b3b[22](https://github.com/sancarn/stdVBA/actions/runs/8010322335/job/21881033889#step:3:23)b6a2fe0cd9a
WARNING: Did not find branch or tag 'dev', assuming revision or ref.
Running command git checkout -q dev
error: pathspec 'dev' did not match any file(s) known to git
error: subprocess-exited-with-error
× git checkout -q dev did not run successfully.
│ exit code: 1
╰─> See above for output.
note: This error originates from a subprocess, and is likely not a problem with pip.
error: subprocess-exited-with-error
× git checkout -q dev did not run successfully.
│ exit code: 1
╰─> See above for output.
note: This error originates from a subprocess, and is likely not a problem with pip.
Error: Process completed with exit code 1.
which is why i changed to using main 😅
For now I've just commented out most of the process. Will re-enable it in the future :)
That error is from the precompiler. That project has now moved to main, while Linting is still in dev. Sorry for the confusion.
Actually, no, sorry, my bad I was telling fibs! That wasn't the issue, that was a very old run 😅 This was the latest run on dev for vba linter:
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 80, in <module>
main()
File "/home/runner/.local/lib/python3.10/site-packages/vba_linter/__main__.py", line 43, in main
results = linter.lint(dir, file_name)
File "/home/runner/.local/lib/python3.10/site-packages/vba_linter/linter.py", line 49, in lint
output.extend(rule.test(ts))
File "/home/runner/.local/lib/python3.10/site-packages/vba_linter/rules/excess_whitespace.py", line 97, in test
output.append((line, column, rule, where, symbol))
UnboundLocalError: local variable 'rule' referenced before assignment
My current config is as follows:
name: Lint VBA
on:
push:
branches:
- dev
- master
pull_request:
jobs:
test-and-static-analysis:
name: Test and Static Analysis
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Install
run: |
python -m pip install --upgrade pip
pip install 'vba_precompiler @ git+https://github.com/Beakerboy/VBA-Precompiler@main'
- name: Precompile
run: |
rm -rf ./src/WIP
python -m vba_precompiler -v7 -sWin64 ./src
rm -rf ./src
- name: Lint
uses: Vba-actions/lint-vba@dev
Anyhow given that it's all WIP, I just expected it to be a known issue.
Thanks. This appears to be a bug. You have excess whitespace after or before a token that I have not planned for.
This has a bandaid on it for now. It looks like it’s complaining about your alignment of the keyword “Lib” in function declarations.
@sancarn the bandaid has been replaced with a permanent fix.
I imagine generally speaking all spaces can be Space+ which may be technically incorrect according to the spec but just fix themselves on import...
Actually, the spec says very little on spaces. They are pretty much allowed anywhere and as many as you want. However the IDE will cut them down to match a particular style. The parsing step looks for code that has semantic problems and will not import or run. Linting looks for formatting and preference issues. Like capitalizations, formatting, spacing, anywhere a programmer has a choice. For example, did you know that >< is just as valid as <> as a not equal operator? The Linting portion will detect if it sees the non-preferred version.
this tool can be run in “parse only” mode and only report parsing issues if you want to do that instead.
@sancarn I remember at some point you said you’d like to help with this whole endeavor, but you don’t know python. I’ve forked a documentation website project to explain the Linting rules to potential users. If you wanted to help with that, that would be awesome. Each page is a simple .md file.
The codebase is here.
the example site is here
I’m working off the dev branch.
Hi beakerboy, I'll try to find some time to help out with this!
Btw in main branch I'm getting the following error when running against stdVBA:
I imagine this is something you know about?