Skip to content

Commit 3ffb2c3

Browse files
Update contribute docs
Signed-off-by: Ayan Sinha Mahapatra <ayansmahapatra@gmail.com>
1 parent 674f869 commit 3ffb2c3

1 file changed

Lines changed: 11 additions & 1 deletion

File tree

docs/source/contribute/contrib_dev.rst

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -118,12 +118,22 @@ set to regenerate test data for specific tests like this:
118118

119119
This command will only regenerate test data for only the tests in `test_package_models.py`,
120120
and we can further specify the tests to regen by using more pytest options like `--lf` and
121-
`-k test_instances`.
121+
`-k test_instances`.
122122

123123
If test data is regenerated, it is important to review the diff for test files and
124124
carefully go through all of it to make sure there are no unintended changes there,
125125
and then commit all the regenerated test data.
126126

127+
To help debug in scancode, we use logging. There are different environement variables
128+
you need to set to turn on logging. In packagedcode::
129+
130+
``SCANCODE_DEBUG_PACKAGE=yes pytest -vvs tests/packagedcode/ --lf``
131+
132+
Or set the ``TRACE`` variable to ``True``. This enables ``logger_debug`` functions
133+
logging variables and shows code execution paths by logging and printing the logs
134+
in the terminal. If debugging full scans run by click, you have to raise exceptions
135+
in addition to setting the TRACE to enable logging.
136+
127137
.. _scancode_toolkit_development_thirdparty_libraries:
128138

129139
Thirdparty libraries and dependencies management

0 commit comments

Comments
 (0)