Skip to main content

WSCheck

PyPi Build Docs DependencyStatus CodeQuality Coverage License

WSCheck is a static analysis tool for whitespaces.

Installation

pip install wscheck

Usage

Check multiple files:

wscheck orange.sh pineapple.xml kiwi.js

Exclude rules:

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

Get list of available rules:

wscheck --list-rules

For details about rules, see Rules

Write CheckStyle output too:

wscheck --checkstyle results.xml pineapple.xml

Example

wscheck examples/multiple_problems.py
In examples/multiple_problems.py line 2:
class LabelPrinter:
^-- WSC007: File begins with newline

In examples/multiple_problems.py line 6:
        self.print_to_pdf()
                           ^-- WSC002: Tailing whitespace

In examples/multiple_problems.py line 9:
   def __generate_pdf(self):
   ^-- WSC003: Indentation is not multiple of 2

In examples/multiple_problems.py line 10:
        pdf_generator = _LabelPdfGenerator()
                                            ^-- WSC001: Bad line ending '\r\n'

In examples/multiple_problems.py line 16:
--->--->os.makedirs(self.__cache_dir, exist_ok=True)
^-- WSC004: Indentation with non-space character

In examples/multiple_problems.py line 22:
        return os.path.join(self.__cache_dir, pdf_name)
                                                       ^-- WSC006: Too many newline at end of file (+1)

Bugs

Bugs or suggestions? Visit the issue tracker.

Benchmark

  • You can run a quick benchmark:

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

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

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

    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:

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

Metadata

Release files for wscheck 1.3.2

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for wscheck 1.3.2
File Size Uploaded
wscheck-1.3.2.tar.gz 25.1 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for wscheck 1.3.2
File Interpreter ABI Platform
wscheck-1.3.2-py3-none-any.whl Python 3 none any Details

Total release size: 44.6 kB

Release files / wscheck-1.3.2.tar.gz

Download URL wscheck-1.3.2.tar.gz
Size 25.1 kB
Tags Source
SHA-256 checksum
How to use checksums
a0bac6ed9826c84b025ac91ee415f1bafb5b2f71afbffba7fcb8b3209a05c3d2
BLAKE2b-256 checksum
How to use checksums
ee739f8a60e80eee70ff8e37bde6fcc93398da0fc84a6c4125b33a45ffa3edc3
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/3.3.0 pkginfo/1.7.0 requests/2.25.1 setuptools/52.0.0 requests-toolbelt/0.9.1 tqdm/4.56.0 CPython/3.7.9

Release files / wscheck-1.3.2-py3-none-any.whl

Download URL wscheck-1.3.2-py3-none-any.whl
Size 19.5 kB
Tags Python 3
SHA-256 checksum
How to use checksums
2950912697f1d2a04712dde583c4ba1090beaa9b9e3471fb4a904f817581efe6
BLAKE2b-256 checksum
How to use checksums
c4c4250b91250de22375304a76e5a09ae6a3e0c7232f3627a7b357c0dfb522e6
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/3.3.0 pkginfo/1.7.0 requests/2.25.1 setuptools/52.0.0 requests-toolbelt/0.9.1 tqdm/4.56.0 CPython/3.7.9

Release history Release notifications | RSS feed

This release

1.3.2 This release

2 release files

1.3.1

2 release files

1.3.0

2 release files

1.2.0

2 release files

1.1.2

2 release files

1.1.1

2 release files

1.1.0

2 release files

1.0.1

2 release files

1.0.0

2 release files

0.1.6

2 release files

0.1.5

2 release files

0.1.4

2 release files

0.1.3

2 release files

0.1.2

2 release files

0.1.1

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page