项目作者: andras-tim

项目描述 :
Whitespace checking tool
高级语言: Python
项目地址: git://github.com/andras-tim/wscheck.git
创建时间: 2016-08-04T11:11:55Z
项目社区:https://github.com/andras-tim/wscheck

开源协议:GNU General Public License v3.0

下载


WSCheck

PyPi
Build
Docs
DependencyStatus
CodeQuality
Coverage
License

WSCheck is a static analysis tool for whitespaces.

Installation

  1. pip install wscheck

Usage

Check multiple files:

  1. wscheck orange.sh pineapple.xml kiwi.js

Exclude rules:

  1. wscheck --exclude WSC002 --exclude WSC003 orange.sh

Get list of available rules:

  1. wscheck --list-rules

For details about rules, see Rules

Write CheckStyle output too:

  1. wscheck --checkstyle results.xml pineapple.xml

Example

  1. wscheck examples/multiple_problems.py
  1. In examples/multiple_problems.py line 2:
  2. class LabelPrinter:
  3. ^-- WSC007: File begins with newline
  4. In examples/multiple_problems.py line 6:
  5. self.print_to_pdf()
  6. ^-- WSC002: Tailing whitespace
  7. In examples/multiple_problems.py line 9:
  8. def __generate_pdf(self):
  9. ^-- WSC003: Indentation is not multiple of 2
  10. In examples/multiple_problems.py line 10:
  11. pdf_generator = _LabelPdfGenerator()
  12. ^-- WSC001: Bad line ending '\r\n'
  13. In examples/multiple_problems.py line 16:
  14. --->--->os.makedirs(self.__cache_dir, exist_ok=True)
  15. ^-- WSC004: Indentation with non-space character
  16. In examples/multiple_problems.py line 22:
  17. return os.path.join(self.__cache_dir, pdf_name)
  18. ^-- WSC006: Too many newline at end of file (+1)

Bugs

Bugs or suggestions? Visit the issue tracker.

Benchmark

  • You can run a quick benchmark:

    1. tox -- tests/performance --quick-benchmark
  • You can run benchmarks and generate histogram for compare calls to each other:

    1. tox -- tests/performance --benchmark-histogram
  • You can run benchmarks and save results for later compare:

    1. tox -- tests/performance --benchmark-save=foo
  • You can run benchmarks and compare with the last saved result with fail treshold:

    1. tox -- tests/performance --benchmark-histogram --benchmark-compare --benchmark-compare-fail=mean:5% --benchmark-sort=name
  • You can run benchmarks and compare with the last saved result by groups:

    1. tox -- tests/performance --benchmark-histogram --benchmark-compare --benchmark-group-by=func
    2. tox -- tests/performance --benchmark-histogram --benchmark-compare --benchmark-group-by=name