tdenewiler / statick-tex Goto Github PK
View Code? Open in Web Editor NEWStatick plugins for discovering and scanning TeX/LaTeX files
Home Page: https://tdenewiler.github.io/statick-tex/
License: Creative Commons Zero v1.0 Universal
Statick plugins for discovering and scanning TeX/LaTeX files
Home Page: https://tdenewiler.github.io/statick-tex/
License: Creative Commons Zero v1.0 Universal
Check all the markdown files with the statick-md tools.
I'm using this repo in part to address sscpac/statick#70. @creffett, I was hoping to get a bit of help from you in order to get the unit tests working. I borrowed some concepts for these plugins from soartech/statick-fortify. My latest work is in the chktex-tool branch -- I will likely merge that into master soon since the plugins work but the unit tests do not.
The issue I am having is running tox locally, where I get several errors similar to:
=========================================================================================== ERRORS ===========================================================================================
__________________________________________________________ ERROR collecting statick_tool/plugins/discovery/tex_discovery_plugin.py ___________________________________________________________
../statick_tool/plugins/discovery/tex_discovery_plugin.py:10: in <module>
from statick_tool.discovery_plugin import DiscoveryPlugin
E ImportError: No module named 'statick_tool.discovery_plugin'
______________________________________________________________ ERROR collecting statick_tool/plugins/tool/chktex_tool_plugin.py ______________________________________________________________
../statick_tool/plugins/tool/chktex_tool_plugin.py:8: in <module>
from statick_tool.issue import Issue
E ImportError: No module named 'statick_tool.issue'
_____________________________________________________________ ERROR collecting statick_tool/plugins/tool/lacheck_tool_plugin.py ______________________________________________________________
../statick_tool/plugins/tool/lacheck_tool_plugin.py:8: in <module>
from statick_tool.issue import Issue
E ImportError: No module named 'statick_tool.issue'
_________________________________________________ ERROR collecting tests/plugins/discovery/tex_discovery_plugin/test_tex_discovery_plugin.py _________________________________________________
../tests/plugins/discovery/tex_discovery_plugin/test_tex_discovery_plugin.py:5: in <module>
from statick_tool.discovery_plugin import DiscoveryPlugin
E ImportError: No module named 'statick_tool.discovery_plugin'
_________________________________________________ ERROR collecting tests/plugins/discovery/tex_discovery_plugin/test_tex_discovery_plugin.py _________________________________________________
ImportError while importing test module '/home/thomas/src/statick/statick-tex/tests/plugins/discovery/tex_discovery_plugin/test_tex_discovery_plugin.py'.
Hint: make sure your test modules/packages have valid Python names.
Traceback:
../tests/plugins/discovery/tex_discovery_plugin/test_tex_discovery_plugin.py:5: in <module>
from statick_tool.discovery_plugin import DiscoveryPlugin
E ImportError: No module named 'statick_tool.discovery_plugin'
When I run this through Travis I get other errors. Examples of the tox output and self check errors are at:
https://travis-ci.org/tdenewiler/statick-tex/jobs/512740453
https://travis-ci.org/tdenewiler/statick-tex/jobs/512740458
Did you come up with a solution to running tox locally and in Travis when writing plugins in a separate repository?
P.S. I will work on expanding the README a lot to help others make plugins in the future, much like what is discussed in sscpac/statick#70.
The lacheck source code contains a tex file that they use for their own unit tests. It would be good to use that same file for a unit test for this tool and make sure we discover the correct number of issues.
https://salsa.debian.org/salve/lacheck/-/blob/master/test.tex
The output from Travis builds to codecov.io is not working. No test results are showing up at codecov. My suspicion is that it has to do with paths of files, as that is one of the things codecov says can go wrong: https://docs.codecov.io/docs/fixing-paths.
This seems to be backed up by Travis output:
../setup.py ... [ 6%]
../plugins/__init__.py ... [ 13%]
../plugins/tex_discovery_plugin/__init__.py ... [ 20%]
../plugins/tex_discovery_plugin/tex_discovery_plugin.py ... [ 27%]
../plugins/tex_tool_plugins/__init__.py ... [ 34%]
../plugins/tex_tool_plugins/chktex_tool_plugin.py ... [ 41%]
../plugins/tex_tool_plugins/lacheck_tool_plugin.py ... [ 48%]
../tests/chktex_tool_plugin/test_chktex_tool_plugin.py ........ [ 67%]
../tests/lacheck_tool_plugin/test_lacheck_tool_plugin.py ........ [ 86%]
../tests/tex_discovery_plugin/test_tex_discovery_plugin.py ...... [100%]
That shows the path to the files relative to the repository structure. However, when determining line coverage the output is:
/home/travis/build/tdenewiler/statick-tex/.tox/py27/lib/python2.7/site-packages/statick_tool/plugins/discovery/tex_discovery_plugin.py 38 1 97% 27
/home/travis/build/tdenewiler/statick-tex/.tox/py27/lib/python2.7/site-packages/statick_tool/plugins/tool/chktex_tool_plugin.py 54 0 100%
/home/travis/build/tdenewiler/statick-tex/.tox/py27/lib/python2.7/site-packages/statick_tool/plugins/tool/lacheck_tool_plugin.py 53 0 100%
For some reason the line coverage is being determined relative to the .tox
directory. This might have something to do with the remapping done to the files in setup.py
.
I tried creating a .codecov.yml
file that has mappings to fix the paths. The few patterns I tried did not work.
Create documentation and build using sphinx. Publish that documentation to readthedocs and/or Github Pages. Do this as an Action on new tags, similar to how tags are packaged and published to PyPI.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.