The plugin parses the jscpd report json and visualizes how the pull request affects the results. The jscpd tool gives you the ability to find duplicated code.
First | Second |
---|---|
examples/babi_rnn.py: 91-123 | examples/babi_memnn.py: 46-79 |
examples/babi_rnn.py: 124-131 | examples/babi_memnn.py: 80-87 |
examples/cifar10_resnet.py: 344-355 | examples/cifar10_resnet.py: 248-259 |
# install danger-js
npm install -g danger
# install jscpd
npm install -g jscpd
# install danger-python
pip install danger-python
# install danger-py-jscpd
pip install danger-py-jscpd
# modify dangerfile.py to include plugin
danger_py_jscpd.jscpd()
# run danger-python
danger-python pr https://github.com/elpassion/danger-py-jscpd/pull/2
Add following to the dangerfile.py
:
import danger_py_jscpd
danger_py_jscpd.jscpd()
To develop the new features, clone the repository and then run:
# install dependencies
poetry install
# activate virtual environment
poetry shell
# run the test suite
pytest
danger-py-jscpd
is released under an MIT license. See LICENSE for more information.