Skip to main content

Detect AI writing patterns (slop) in your codebase

Project description

dslop

Detect AI writing patterns (slop) in your codebase.

dslop is a fast CLI linter for prose. It flags telltale LLM writing patterns (em-dashes, double-hyphen dashes, "it's not X, it's Y" constructions) and statistical tells (uniform sentence rhythm, flat word-frequency distributions) that human writing rarely produces.

Install

pip install dslop
# or
uvx dslop .

Use

dslop                       # check current directory
dslop README.md docs/       # check specific paths
dslop --config dslop.toml   # use a specific config

# Read from stdin:
echo "It's not a tool — it's a platform." | dslop -
pbpaste | dslop                                         # clipboard
git show HEAD:README.md | dslop                         # a past revision

Exits non-zero on violations, so it drops into CI or pre-commit unchanged.

Pre-commit

repos:
  - repo: https://github.com/prefectlabs/dslop
    rev: v0.1.0
    hooks:
      - id: dslop

Configure

Create dslop.toml at your repo root:

[patterns]
em-dash = true
double-hyphen = true
contrastive = true
demonstrative-is = true
filler-adverbs = true          # quietly, actually, really, simply, essentially, ...
weasel-connectives = true      # which means, in turn, the reality is, ...
banned-flourish = true         # worth noting, to be clear, at the end of the day, ...
banned-negation = true         # "not" / "n't"
negation-pair = true           # "not X, not Y"
symmetric-negation = true      # "fine if X, wrong if Y" / "not X but Y"
which-chain = true             # 3+ "which" in a single sentence
but-opener = true              # short sentences starting with "But"
aphorism = true                # "X does not Y." one-liners
summary-capstone = true        # paragraph-final "That is the X."
declarative-callback = true    # paragraph-final fragment callbacks
three-beat = true              # 3 consecutive short sentences in a paragraph

[metrics]
sentence-length-cv = 0.3
sentence-length-kurtosis = 1.5

[metrics.word-freq-dispersion]
threshold = 0.6
chunk-size = 200
top-n = 20

Each metric accepts a threshold (f64) or false to disable.

License

Apache-2.0. See LICENSE.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

dslop-0.2.2.tar.gz (181.8 kB view details)

Uploaded Source

Built Distributions

If you're not sure about the file name format, learn more about wheel file names.

dslop-0.2.2-py3-none-win_amd64.whl (1.1 MB view details)

Uploaded Python 3Windows x86-64

dslop-0.2.2-py3-none-musllinux_1_2_x86_64.whl (1.3 MB view details)

Uploaded Python 3musllinux: musl 1.2+ x86-64

dslop-0.2.2-py3-none-musllinux_1_2_aarch64.whl (1.2 MB view details)

Uploaded Python 3musllinux: musl 1.2+ ARM64

dslop-0.2.2-py3-none-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (1.2 MB view details)

Uploaded Python 3manylinux: glibc 2.17+ x86-64

dslop-0.2.2-py3-none-manylinux_2_17_aarch64.manylinux2014_aarch64.whl (1.1 MB view details)

Uploaded Python 3manylinux: glibc 2.17+ ARM64

dslop-0.2.2-py3-none-macosx_11_0_arm64.whl (1.1 MB view details)

Uploaded Python 3macOS 11.0+ ARM64

dslop-0.2.2-py3-none-macosx_10_12_x86_64.whl (1.2 MB view details)

Uploaded Python 3macOS 10.12+ x86-64

File details

Details for the file dslop-0.2.2.tar.gz.

File metadata

  • Download URL: dslop-0.2.2.tar.gz
  • Upload date:
  • Size: 181.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: maturin/1.13.1

File hashes

Hashes for dslop-0.2.2.tar.gz
Algorithm Hash digest
SHA256 e9a1b396939431af10cc9e173805f07bebdc03a6e0688b89e9c60004168bd772
MD5 4bf914c82585aaa8b59bc2065ef7639b
BLAKE2b-256 cd5275955c5c092bf45988049335f8cbaa955369946ed4e561c5fad372422d4f

See more details on using hashes here.

File details

Details for the file dslop-0.2.2-py3-none-win_amd64.whl.

File metadata

  • Download URL: dslop-0.2.2-py3-none-win_amd64.whl
  • Upload date:
  • Size: 1.1 MB
  • Tags: Python 3, Windows x86-64
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: maturin/1.13.1

File hashes

Hashes for dslop-0.2.2-py3-none-win_amd64.whl
Algorithm Hash digest
SHA256 a0a5e7aeb2298fede2efbf83b60fa98b6c40484d298329e0efef8eb6786e58ab
MD5 5d1f3955c775c68bec6afed14d0400d4
BLAKE2b-256 9df140e3e277fd0e586aca9534fd9021144385d4ffc372f32d8acf30b0304cf0

See more details on using hashes here.

File details

Details for the file dslop-0.2.2-py3-none-musllinux_1_2_x86_64.whl.

File metadata

File hashes

Hashes for dslop-0.2.2-py3-none-musllinux_1_2_x86_64.whl
Algorithm Hash digest
SHA256 ddfa878d08ec3c4033a986e8525159b2197ead9fc99464c3b4326be32b7b0945
MD5 3decb4f9cc14babae1a0fe5bf24919c3
BLAKE2b-256 3474d6466396787ffd6fe5a119a8eb1e373532aef6641a8ce7660a4060c00991

See more details on using hashes here.

File details

Details for the file dslop-0.2.2-py3-none-musllinux_1_2_aarch64.whl.

File metadata

File hashes

Hashes for dslop-0.2.2-py3-none-musllinux_1_2_aarch64.whl
Algorithm Hash digest
SHA256 6a49a5803857f9ad2e04daca289ed3e21794aa29add85e1fdfd6f4fc6d301dac
MD5 41895a3e0bd0153370bd182c57eba291
BLAKE2b-256 e0a4868bbf8992c1f862c8cf5d15db4725deadeb4b0a5bb905d459dba106ab2a

See more details on using hashes here.

File details

Details for the file dslop-0.2.2-py3-none-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.

File metadata

File hashes

Hashes for dslop-0.2.2-py3-none-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 68f5feb2cb199a0098c986263f5a2825154ecb3fdbef73f31f66c77b966dfe6b
MD5 082074d508cfee5cf942c98503632944
BLAKE2b-256 8f5ccfde2cda9f10292c5fab8d9b603d7b2e09afa11aca65f91acd801274ce46

See more details on using hashes here.

File details

Details for the file dslop-0.2.2-py3-none-manylinux_2_17_aarch64.manylinux2014_aarch64.whl.

File metadata

File hashes

Hashes for dslop-0.2.2-py3-none-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
Algorithm Hash digest
SHA256 f79038e556ff8c044973c4b2b374d831557ea73717fe1b46b7658bc27cb6ba0c
MD5 406fa15c72b88f9bdd30e7dadec0f277
BLAKE2b-256 78c0321fccf567763dcfe31cb94d8e59b733ede955b552160736019bbf61d0c6

See more details on using hashes here.

File details

Details for the file dslop-0.2.2-py3-none-macosx_11_0_arm64.whl.

File metadata

File hashes

Hashes for dslop-0.2.2-py3-none-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 9d1493cbb7c806c8ecebee572734350b8c9985c55d47480d92db458be68e4d87
MD5 ce197d3d9e12ebbd907b3a1d5170d101
BLAKE2b-256 5e6f854815f39c0cb7661fdbfbb44fd1be96abc5a445577753026914d31612b3

See more details on using hashes here.

File details

Details for the file dslop-0.2.2-py3-none-macosx_10_12_x86_64.whl.

File metadata

File hashes

Hashes for dslop-0.2.2-py3-none-macosx_10_12_x86_64.whl
Algorithm Hash digest
SHA256 696e3448b03d521325aa5713f5843f4b98116a99f31afee713b75077d910d714
MD5 4a0a4d5a9e11bf51d32acf646eb122da
BLAKE2b-256 485f9af58b91f74407ba5f7d085ba0979dfb91155818e91c3ccebc20bdd30af4

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page