Skip to content

elpassion/danger-py-jscpd

Repository files navigation

PyPI Python versions Build Status

danger-py-jscpd

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.

Example output in PR

JSCPD found 3 clone(s)

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

Installation

# 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()

Development

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 

License

danger-py-jscpd is released under an MIT license. See LICENSE for more information.

About

danger-python plugin for detecting copy/paste

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages