papa-lint 0.1.0__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (165) hide show
  1. papa_lint-0.1.0/.gitattributes +1 -0
  2. papa_lint-0.1.0/.github/ISSUE_TEMPLATE/bug_report.yml +34 -0
  3. papa_lint-0.1.0/.github/ISSUE_TEMPLATE/config.yml +5 -0
  4. papa_lint-0.1.0/.github/ISSUE_TEMPLATE/feature_request.yml +24 -0
  5. papa_lint-0.1.0/.github/PULL_REQUEST_TEMPLATE.md +23 -0
  6. papa_lint-0.1.0/.github/workflows/ci.yml +34 -0
  7. papa_lint-0.1.0/.github/workflows/publish.yml +38 -0
  8. papa_lint-0.1.0/.gitignore +8 -0
  9. papa_lint-0.1.0/AGENTS.md +34 -0
  10. papa_lint-0.1.0/CLAUDE.md +22 -0
  11. papa_lint-0.1.0/CODE_OF_CONDUCT.md +57 -0
  12. papa_lint-0.1.0/CONTRIBUTING.md +89 -0
  13. papa_lint-0.1.0/LICENSE +21 -0
  14. papa_lint-0.1.0/PKG-INFO +291 -0
  15. papa_lint-0.1.0/README.md +264 -0
  16. papa_lint-0.1.0/SECURITY.md +25 -0
  17. papa_lint-0.1.0/docs/assets/sample-report.html +79 -0
  18. papa_lint-0.1.0/docs/eyes.md +43 -0
  19. papa_lint-0.1.0/docs/llm-contract.md +121 -0
  20. papa_lint-0.1.0/pyproject.toml +43 -0
  21. papa_lint-0.1.0/spec.md +226 -0
  22. papa_lint-0.1.0/src/papa/__init__.py +59 -0
  23. papa_lint-0.1.0/src/papa/__main__.py +5 -0
  24. papa_lint-0.1.0/src/papa/aggregate.py +78 -0
  25. papa_lint-0.1.0/src/papa/analyzers/__init__.py +35 -0
  26. papa_lint-0.1.0/src/papa/analyzers/adverbs.py +33 -0
  27. papa_lint-0.1.0/src/papa/analyzers/complex_phrase.py +62 -0
  28. papa_lint-0.1.0/src/papa/analyzers/passive.py +48 -0
  29. papa_lint-0.1.0/src/papa/analyzers/readability.py +41 -0
  30. papa_lint-0.1.0/src/papa/cli.py +231 -0
  31. papa_lint-0.1.0/src/papa/config.py +85 -0
  32. papa_lint-0.1.0/src/papa/ingest.py +158 -0
  33. papa_lint-0.1.0/src/papa/inputs.py +135 -0
  34. papa_lint-0.1.0/src/papa/models.py +89 -0
  35. papa_lint-0.1.0/src/papa/normalize.py +36 -0
  36. papa_lint-0.1.0/src/papa/reporters/__init__.py +10 -0
  37. papa_lint-0.1.0/src/papa/reporters/cli.py +231 -0
  38. papa_lint-0.1.0/src/papa/reporters/common.py +27 -0
  39. papa_lint-0.1.0/src/papa/reporters/concise.py +27 -0
  40. papa_lint-0.1.0/src/papa/reporters/html.py +195 -0
  41. papa_lint-0.1.0/src/papa/reporters/json_report.py +56 -0
  42. papa_lint-0.1.0/src/papa/scoring.py +44 -0
  43. papa_lint-0.1.0/src/papa/sentences.py +36 -0
  44. papa_lint-0.1.0/tests/test_analyzers.py +83 -0
  45. papa_lint-0.1.0/tests/test_cli.py +142 -0
  46. papa_lint-0.1.0/tests/test_ingest.py +164 -0
  47. papa_lint-0.1.0/tests/test_normalize.py +34 -0
  48. papa_lint-0.1.0/tests/test_scoring.py +85 -0
  49. papa_lint-0.1.0/tests/ux/corpora/all-findings.md +17 -0
  50. papa_lint-0.1.0/tests/ux/corpora/bad-utf8.txt +1 -0
  51. papa_lint-0.1.0/tests/ux/corpora/badtool/ok.md +1 -0
  52. papa_lint-0.1.0/tests/ux/corpora/badtool/pyproject.toml +1 -0
  53. papa_lint-0.1.0/tests/ux/corpora/big/page-01.md +17 -0
  54. papa_lint-0.1.0/tests/ux/corpora/big/page-02.md +17 -0
  55. papa_lint-0.1.0/tests/ux/corpora/big/page-03.md +17 -0
  56. papa_lint-0.1.0/tests/ux/corpora/big/page-04.md +17 -0
  57. papa_lint-0.1.0/tests/ux/corpora/big/page-05.md +17 -0
  58. papa_lint-0.1.0/tests/ux/corpora/big/page-06.md +17 -0
  59. papa_lint-0.1.0/tests/ux/corpora/big/page-07.md +17 -0
  60. papa_lint-0.1.0/tests/ux/corpora/big/page-08.md +17 -0
  61. papa_lint-0.1.0/tests/ux/corpora/big/page-09.md +17 -0
  62. papa_lint-0.1.0/tests/ux/corpora/big/page-10.md +17 -0
  63. papa_lint-0.1.0/tests/ux/corpora/big/page-11.md +17 -0
  64. papa_lint-0.1.0/tests/ux/corpora/big/page-12.md +17 -0
  65. papa_lint-0.1.0/tests/ux/corpora/big/page-13.md +17 -0
  66. papa_lint-0.1.0/tests/ux/corpora/big/page-14.md +17 -0
  67. papa_lint-0.1.0/tests/ux/corpora/code-only.md +4 -0
  68. papa_lint-0.1.0/tests/ux/corpora/easy.txt +1 -0
  69. papa_lint-0.1.0/tests/ux/corpora/empty.md +0 -0
  70. papa_lint-0.1.0/tests/ux/corpora/hard.md +1 -0
  71. papa_lint-0.1.0/tests/ux/corpora/html-bait.md +1 -0
  72. papa_lint-0.1.0/tests/ux/corpora/long.md +48 -0
  73. papa_lint-0.1.0/tests/ux/corpora/mdx-site/page.mdx +20 -0
  74. papa_lint-0.1.0/tests/ux/corpora/mdx-site/plain.md +1 -0
  75. papa_lint-0.1.0/tests/ux/corpora/project/.hidden/secret.md +1 -0
  76. papa_lint-0.1.0/tests/ux/corpora/project/README.md +1 -0
  77. papa_lint-0.1.0/tests/ux/corpora/project/docs/faq.txt +1 -0
  78. papa_lint-0.1.0/tests/ux/corpora/project/docs/generated/api.md +1 -0
  79. papa_lint-0.1.0/tests/ux/corpora/project/docs/guide.md +3 -0
  80. papa_lint-0.1.0/tests/ux/corpora/project/notes/meeting notes.md +1 -0
  81. papa_lint-0.1.0/tests/ux/corpora/project/papa.toml +3 -0
  82. papa_lint-0.1.0/tests/ux/corpora/readme-style.md +29 -0
  83. papa_lint-0.1.0/tests/ux/corpora/singular.txt +1 -0
  84. papa_lint-0.1.0/tests/ux/corpora/typo.toml +2 -0
  85. papa_lint-0.1.0/tests/ux/corpora/unicode-crlf.txt +2 -0
  86. papa_lint-0.1.0/tests/ux/corpora/wrong-type.toml +1 -0
  87. papa_lint-0.1.0/tests/ux/eyes.json +103 -0
  88. papa_lint-0.1.0/tests/ux/papa_checks.py +96 -0
  89. papa_lint-0.1.0/tests/ux/snapshots/all-findings-piped.txt +24 -0
  90. papa_lint-0.1.0/tests/ux/snapshots/all-findings-tty-40.txt +37 -0
  91. papa_lint-0.1.0/tests/ux/snapshots/all-findings-tty-80.txt +24 -0
  92. papa_lint-0.1.0/tests/ux/snapshots/all-shows-everything.txt +209 -0
  93. papa_lint-0.1.0/tests/ux/snapshots/bad-utf8.txt +6 -0
  94. papa_lint-0.1.0/tests/ux/snapshots/code-only-plus-prose.txt +11 -0
  95. papa_lint-0.1.0/tests/ux/snapshots/color-always-piped.txt +24 -0
  96. papa_lint-0.1.0/tests/ux/snapshots/concise-findings-are-advisory.txt +7 -0
  97. papa_lint-0.1.0/tests/ux/snapshots/concise-gate-only.txt +6 -0
  98. papa_lint-0.1.0/tests/ux/snapshots/concise.txt +13 -0
  99. papa_lint-0.1.0/tests/ux/snapshots/config-bad-utf8.txt +6 -0
  100. papa_lint-0.1.0/tests/ux/snapshots/config-file.txt +41 -0
  101. papa_lint-0.1.0/tests/ux/snapshots/config-override.txt +41 -0
  102. papa_lint-0.1.0/tests/ux/snapshots/config-shown.txt +41 -0
  103. papa_lint-0.1.0/tests/ux/snapshots/config-typo.txt +6 -0
  104. papa_lint-0.1.0/tests/ux/snapshots/config-wrong-type.txt +9 -0
  105. papa_lint-0.1.0/tests/ux/snapshots/dedupe.txt +9 -0
  106. papa_lint-0.1.0/tests/ux/snapshots/directory.txt +35 -0
  107. papa_lint-0.1.0/tests/ux/snapshots/empty-file.txt +6 -0
  108. papa_lint-0.1.0/tests/ux/snapshots/exclude-bracket.txt +16 -0
  109. papa_lint-0.1.0/tests/ux/snapshots/exclude-doublestar-zero-dirs.txt +9 -0
  110. papa_lint-0.1.0/tests/ux/snapshots/exclude-everything.txt +6 -0
  111. papa_lint-0.1.0/tests/ux/snapshots/exclude.txt +24 -0
  112. papa_lint-0.1.0/tests/ux/snapshots/folder-finds-mdx.txt +17 -0
  113. papa_lint-0.1.0/tests/ux/snapshots/formula-line-explained.txt +9 -0
  114. papa_lint-0.1.0/tests/ux/snapshots/gate-display-precision.txt +10 -0
  115. papa_lint-0.1.0/tests/ux/snapshots/gate-fail-no-findings-wording.txt +10 -0
  116. papa_lint-0.1.0/tests/ux/snapshots/gate-fail.txt +17 -0
  117. papa_lint-0.1.0/tests/ux/snapshots/gate-nan.txt +7 -0
  118. papa_lint-0.1.0/tests/ux/snapshots/gate-negative.txt +7 -0
  119. papa_lint-0.1.0/tests/ux/snapshots/gate-pass.txt +10 -0
  120. papa_lint-0.1.0/tests/ux/snapshots/glob-finds-mdx.txt +9 -0
  121. papa_lint-0.1.0/tests/ux/snapshots/help.txt +55 -0
  122. papa_lint-0.1.0/tests/ux/snapshots/hints.txt +24 -0
  123. papa_lint-0.1.0/tests/ux/snapshots/html-bait.txt +19 -0
  124. papa_lint-0.1.0/tests/ux/snapshots/html-multi.txt +51 -0
  125. papa_lint-0.1.0/tests/ux/snapshots/html-shows-errors.txt +21 -0
  126. papa_lint-0.1.0/tests/ux/snapshots/html-shows-hints.txt +37 -0
  127. papa_lint-0.1.0/tests/ux/snapshots/html-single.txt +37 -0
  128. papa_lint-0.1.0/tests/ux/snapshots/json-all-empty.txt +25 -0
  129. papa_lint-0.1.0/tests/ux/snapshots/json-all-missing.txt +25 -0
  130. papa_lint-0.1.0/tests/ux/snapshots/json-multi.txt +245 -0
  131. papa_lint-0.1.0/tests/ux/snapshots/json-single.txt +161 -0
  132. papa_lint-0.1.0/tests/ux/snapshots/json-unmatched-glob.txt +45 -0
  133. papa_lint-0.1.0/tests/ux/snapshots/json-with-error.txt +45 -0
  134. papa_lint-0.1.0/tests/ux/snapshots/list-items-are-separate.txt +56 -0
  135. papa_lint-0.1.0/tests/ux/snapshots/long-file-all.txt +48 -0
  136. papa_lint-0.1.0/tests/ux/snapshots/long-file-output-is-bounded.txt +42 -0
  137. papa_lint-0.1.0/tests/ux/snapshots/many-files-output-is-bounded.txt +24 -0
  138. papa_lint-0.1.0/tests/ux/snapshots/markdown-grade-is-prose-grade.txt +15 -0
  139. papa_lint-0.1.0/tests/ux/snapshots/markdown-syntax-is-not-prose.txt +6 -0
  140. papa_lint-0.1.0/tests/ux/snapshots/mdx-grade-is-prose-grade.txt +10 -0
  141. papa_lint-0.1.0/tests/ux/snapshots/mdx-markup-is-not-prose.txt +6 -0
  142. papa_lint-0.1.0/tests/ux/snapshots/missing-file.txt +6 -0
  143. papa_lint-0.1.0/tests/ux/snapshots/mixed-missing-and-good.txt +11 -0
  144. papa_lint-0.1.0/tests/ux/snapshots/multi-gate-summary.txt +26 -0
  145. papa_lint-0.1.0/tests/ux/snapshots/narrow-quote-keeps-context.txt +37 -0
  146. papa_lint-0.1.0/tests/ux/snapshots/no-args-empty-stdin.txt +6 -0
  147. papa_lint-0.1.0/tests/ux/snapshots/no-args-tty.txt +55 -0
  148. papa_lint-0.1.0/tests/ux/snapshots/no-color-env.txt +24 -0
  149. papa_lint-0.1.0/tests/ux/snapshots/no-config.txt +47 -0
  150. papa_lint-0.1.0/tests/ux/snapshots/no-repeated-labels.txt +24 -0
  151. papa_lint-0.1.0/tests/ux/snapshots/output-dir-missing.txt +6 -0
  152. papa_lint-0.1.0/tests/ux/snapshots/pyproject-tool-not-table.txt +9 -0
  153. papa_lint-0.1.0/tests/ux/snapshots/quiet-still-writes-output.txt +37 -0
  154. papa_lint-0.1.0/tests/ux/snapshots/quiet.txt +6 -0
  155. papa_lint-0.1.0/tests/ux/snapshots/quoted-glob.txt +39 -0
  156. papa_lint-0.1.0/tests/ux/snapshots/singular-piped.txt +16 -0
  157. papa_lint-0.1.0/tests/ux/snapshots/skipped-counts-explicit.txt +11 -0
  158. papa_lint-0.1.0/tests/ux/snapshots/stdin-dash-filename.txt +24 -0
  159. papa_lint-0.1.0/tests/ux/snapshots/stdin-pipe.txt +9 -0
  160. papa_lint-0.1.0/tests/ux/snapshots/stdin-twice.txt +6 -0
  161. papa_lint-0.1.0/tests/ux/snapshots/summary-only.txt +9 -0
  162. papa_lint-0.1.0/tests/ux/snapshots/summary-with-json-rejected.txt +7 -0
  163. papa_lint-0.1.0/tests/ux/snapshots/typo-flag.txt +7 -0
  164. papa_lint-0.1.0/tests/ux/snapshots/unicode-crlf.txt +8 -0
  165. papa_lint-0.1.0/tests/ux/snapshots/unmatched-glob.txt +6 -0
@@ -0,0 +1 @@
1
+ tests/ux/corpora/** -text
@@ -0,0 +1,34 @@
1
+ name: Bug report
2
+ description: Something in Papa is wrong or crashes
3
+ labels: ["bug"]
4
+ body:
5
+ - type: textarea
6
+ id: what
7
+ attributes:
8
+ label: What happened
9
+ description: What went wrong, and what did you expect instead?
10
+ validations:
11
+ required: true
12
+ - type: textarea
13
+ id: repro
14
+ attributes:
15
+ label: How to reproduce
16
+ description: The exact command and, if possible, a small input file or snippet.
17
+ placeholder: |
18
+ papa sample.md --max-grade 10
19
+ validations:
20
+ required: true
21
+ - type: input
22
+ id: version
23
+ attributes:
24
+ label: Papa version
25
+ description: Output of `papa --version` (or the commit you are on).
26
+ validations:
27
+ required: false
28
+ - type: input
29
+ id: python
30
+ attributes:
31
+ label: Python version
32
+ placeholder: "3.11"
33
+ validations:
34
+ required: false
@@ -0,0 +1,5 @@
1
+ blank_issues_enabled: false
2
+ contact_links:
3
+ - name: Security report
4
+ url: https://github.com/bharadwaj-pendyala/papa/security/advisories/new
5
+ about: Report a vulnerability privately. Do not open a public issue.
@@ -0,0 +1,24 @@
1
+ name: Feature request
2
+ description: Suggest an analyzer, reporter, ingestor, or improvement
3
+ labels: ["enhancement"]
4
+ body:
5
+ - type: textarea
6
+ id: problem
7
+ attributes:
8
+ label: The problem
9
+ description: What are you trying to do that Papa does not support yet?
10
+ validations:
11
+ required: true
12
+ - type: textarea
13
+ id: idea
14
+ attributes:
15
+ label: Proposed solution
16
+ description: What would the feature look like? A flag, an analyzer, a reporter?
17
+ validations:
18
+ required: false
19
+ - type: textarea
20
+ id: alternatives
21
+ attributes:
22
+ label: Alternatives considered
23
+ validations:
24
+ required: false
@@ -0,0 +1,23 @@
1
+ <!-- Thanks for contributing to Papa. Keep PRs small and focused. -->
2
+
3
+ ## What and why
4
+
5
+ <!-- What does this change, and why? Link any related issue with "Closes #123". -->
6
+
7
+ ## Type of change
8
+
9
+ - [ ] Bug fix
10
+ - [ ] New feature (analyzer, reporter, ingestor)
11
+ - [ ] Docs
12
+ - [ ] Refactor or chore
13
+
14
+ ## Checklist
15
+
16
+ - [ ] `pytest` passes locally.
17
+ - [ ] New behavior has a test.
18
+ - [ ] README or spec.md updated if public behavior changed.
19
+ - [ ] No em dashes in prose files.
20
+
21
+ ## Notes for the reviewer
22
+
23
+ <!-- Anything you want a reviewer to look at first, tradeoffs, or open questions. -->
@@ -0,0 +1,34 @@
1
+ name: CI
2
+
3
+ on:
4
+ push:
5
+ branches: [main]
6
+ pull_request:
7
+
8
+ jobs:
9
+ test:
10
+ runs-on: ubuntu-latest
11
+ strategy:
12
+ fail-fast: false
13
+ matrix:
14
+ python-version: ["3.11", "3.12", "3.13"]
15
+ steps:
16
+ - uses: actions/checkout@v4
17
+ - name: Set up Python ${{ matrix.python-version }}
18
+ uses: actions/setup-python@v5
19
+ with:
20
+ python-version: ${{ matrix.python-version }}
21
+ - name: Install
22
+ run: pip install -e ".[dev]"
23
+ - name: Test
24
+ run: pytest -q
25
+ - name: UX checks (eyes)
26
+ run: |
27
+ pip install userlens
28
+ eyes run
29
+ - name: Upload eyes report
30
+ if: failure()
31
+ uses: actions/upload-artifact@v4
32
+ with:
33
+ name: eyes-${{ matrix.python-version }}
34
+ path: artifacts/eyes
@@ -0,0 +1,38 @@
1
+ name: Publish
2
+
3
+ # Runs when a GitHub release is published. PyPI trusts this workflow through
4
+ # trusted publishing, so no API token is stored in the repo.
5
+ on:
6
+ release:
7
+ types: [published]
8
+
9
+ jobs:
10
+ build:
11
+ runs-on: ubuntu-latest
12
+ steps:
13
+ - uses: actions/checkout@v4
14
+ - uses: actions/setup-python@v5
15
+ with:
16
+ python-version: "3.12"
17
+ - name: Check the tag matches the package version
18
+ run: |
19
+ version=$(python -c "import tomllib;print(tomllib.load(open('pyproject.toml','rb'))['project']['version'])")
20
+ test "v$version" = "$GITHUB_REF_NAME" || { echo "tag $GITHUB_REF_NAME does not match version $version"; exit 1; }
21
+ - run: pip install build && python -m build
22
+ - uses: actions/upload-artifact@v4
23
+ with:
24
+ name: dist
25
+ path: dist/
26
+
27
+ publish:
28
+ needs: build
29
+ runs-on: ubuntu-latest
30
+ environment: pypi
31
+ permissions:
32
+ id-token: write
33
+ steps:
34
+ - uses: actions/download-artifact@v4
35
+ with:
36
+ name: dist
37
+ path: dist/
38
+ - uses: pypa/gh-action-pypi-publish@release/v1
@@ -0,0 +1,8 @@
1
+ .herdr/
2
+ *.worktrees/
3
+ __pycache__/
4
+ *.pyc
5
+ .venv/
6
+ dist/
7
+ .venv/
8
+ artifacts/
@@ -0,0 +1,34 @@
1
+ # Notes for coding agents
2
+
3
+ - Set up: `python -m venv .venv && .venv/bin/pip install -e ".[dev,eyes]"`.
4
+ - Use the venv for every command: `.venv/bin/pytest`, `.venv/bin/eyes run`.
5
+ eyes runs papa with the interpreter that runs eyes, so an `eyes` from another
6
+ environment without papa's dependencies fails every case.
7
+ - Read `docs/eyes.md` before you change user-facing output. Add `--browser`
8
+ to `eyes run` to see the HTML report and terminal output as screenshots.
9
+ - The JSON report is a contract (`docs/llm-contract.md`). Change its shape only
10
+ with a version bump.
11
+ - No em dashes in prose. Keep comments few and about the why.
12
+
13
+ <!-- eyes:start -->
14
+ ## Verify changes with eyes
15
+
16
+ This repo uses [userlens](https://github.com/bharadwaj-pendyala/userlens)
17
+ to check that the product works the way a user uses it. The cases are in
18
+ `tests/ux/eyes.json`.
19
+
20
+ When you build or change a feature:
21
+
22
+ 1. Before you write code, add cases for what the feature must do: the happy
23
+ path, the output and files it must produce, and the errors a user can hit.
24
+ Run `eyes run --case <id>` and confirm that the new cases fail.
25
+ 2. Build until they pass. After each run, read `artifacts/eyes/report.json`,
26
+ starting with `failures`.
27
+ 3. Open the screenshots and `stdout.txt` files of the cases you touched.
28
+ Confirm the result is right, not only that the checks pass.
29
+ 4. Run `eyes run` for every case before you finish. Fix what you broke.
30
+ 5. Read each `artifacts/eyes/cases/<id>/snapshot.diff`. Run
31
+ `eyes approve --case <id>` only for changes you meant to make.
32
+
33
+ Fix the product, not the check. Change a check only when the check is wrong.
34
+ <!-- eyes:end -->
@@ -0,0 +1,22 @@
1
+ <!-- eyes:start -->
2
+ ## Verify changes with eyes
3
+
4
+ This repo uses [userlens](https://github.com/bharadwaj-pendyala/userlens)
5
+ to check that the product works the way a user uses it. The cases are in
6
+ `tests/ux/eyes.json`.
7
+
8
+ When you build or change a feature:
9
+
10
+ 1. Before you write code, add cases for what the feature must do: the happy
11
+ path, the output and files it must produce, and the errors a user can hit.
12
+ Run `eyes run --case <id>` and confirm that the new cases fail.
13
+ 2. Build until they pass. After each run, read `artifacts/eyes/report.json`,
14
+ starting with `failures`.
15
+ 3. Open the screenshots and `stdout.txt` files of the cases you touched.
16
+ Confirm the result is right, not only that the checks pass.
17
+ 4. Run `eyes run` for every case before you finish. Fix what you broke.
18
+ 5. Read each `artifacts/eyes/cases/<id>/snapshot.diff`. Run
19
+ `eyes approve --case <id>` only for changes you meant to make.
20
+
21
+ Fix the product, not the check. Change a check only when the check is wrong.
22
+ <!-- eyes:end -->
@@ -0,0 +1,57 @@
1
+ # Contributor Covenant Code of Conduct
2
+
3
+ ## Our Pledge
4
+
5
+ We as members, contributors, and leaders pledge to make participation in our
6
+ community a harassment free experience for everyone, regardless of age, body
7
+ size, visible or invisible disability, ethnicity, sex characteristics, gender
8
+ identity and expression, level of experience, education, socio economic status,
9
+ nationality, personal appearance, race, religion, or sexual identity and
10
+ orientation.
11
+
12
+ We pledge to act and interact in ways that contribute to an open, welcoming,
13
+ diverse, inclusive, and healthy community.
14
+
15
+ ## Our Standards
16
+
17
+ Examples of behavior that contributes to a positive environment:
18
+
19
+ - Showing empathy and kindness toward other people.
20
+ - Being respectful of differing opinions, viewpoints, and experiences.
21
+ - Giving and gracefully accepting constructive feedback.
22
+ - Accepting responsibility, apologizing to those affected by our mistakes, and
23
+ learning from the experience.
24
+ - Focusing on what is best for the overall community.
25
+
26
+ Examples of unacceptable behavior:
27
+
28
+ - The use of sexualized language or imagery, and sexual attention or advances.
29
+ - Trolling, insulting or derogatory comments, and personal or political attacks.
30
+ - Public or private harassment.
31
+ - Publishing others' private information, such as a physical or email address,
32
+ without their explicit permission.
33
+ - Other conduct which could reasonably be considered inappropriate in a
34
+ professional setting.
35
+
36
+ ## Enforcement Responsibilities
37
+
38
+ Community leaders are responsible for clarifying and enforcing our standards of
39
+ acceptable behavior and will take appropriate and fair corrective action in
40
+ response to any behavior that they deem inappropriate, threatening, offensive,
41
+ or harmful.
42
+
43
+ ## Scope
44
+
45
+ This Code of Conduct applies within all community spaces, and also applies when
46
+ an individual is officially representing the community in public spaces.
47
+
48
+ ## Enforcement
49
+
50
+ Instances of abusive, harassing, or otherwise unacceptable behavior may be
51
+ reported to the maintainer at bharadwajpendyala@gmail.com. All complaints will
52
+ be reviewed and investigated promptly and fairly.
53
+
54
+ ## Attribution
55
+
56
+ This Code of Conduct is adapted from the Contributor Covenant, version 2.1,
57
+ available at https://www.contributor-covenant.org/version/2/1/code_of_conduct.html.
@@ -0,0 +1,89 @@
1
+ # Contributing to Papa
2
+
3
+ Thanks for helping make prose more readable. Papa is open source (MIT) and contributions of every size are welcome: bug reports, docs fixes, new analyzers, and reporters.
4
+
5
+ ## Ways to contribute
6
+
7
+ - **Report a bug or request a feature** via [issues](https://github.com/bharadwaj-pendyala/papa/issues). Use the templates.
8
+ - **Pick a `good first issue`** if you are new. They are [labeled](https://github.com/bharadwaj-pendyala/papa/labels/good%20first%20issue).
9
+ - **Open a pull request** for a fix or a feature. Small, focused PRs get reviewed fastest.
10
+
11
+ ## Development setup
12
+
13
+ Papa is a Python 3.11+ project.
14
+
15
+ ```bash
16
+ git clone https://github.com/bharadwaj-pendyala/papa.git
17
+ cd papa
18
+ python -m venv .venv && source .venv/bin/activate
19
+ pip install -e ".[dev]"
20
+ pytest
21
+ ```
22
+
23
+ On macOS, if `papa` fails with `No module named 'papa'` after an install, a
24
+ sync tool such as iCloud may have hidden the editable `.pth` file. Python 3.13
25
+ skips hidden `.pth` files. Run `chflags nohidden .venv/lib/python*/site-packages/*.pth`.
26
+
27
+ Run the CLI against a file to see it work:
28
+
29
+ ```bash
30
+ papa README.md
31
+ papa README.md --report json
32
+ ```
33
+
34
+ ## Check the UX with eyes
35
+
36
+ Papa's UX checks run the CLI like a user does and check the output. They use
37
+ [userlens](https://github.com/bharadwaj-pendyala/userlens). Run them before
38
+ you open a PR that changes what users see:
39
+
40
+ ```bash
41
+ pip install -e ".[dev,eyes]"
42
+ eyes run # terminal, JSON and HTML checks
43
+ eyes run --browser # also screenshots and layout checks
44
+ ```
45
+
46
+ See [docs/eyes.md](docs/eyes.md) for how to add a case and approve output
47
+ changes.
48
+
49
+ ## Project layout
50
+
51
+ ```
52
+ src/papa/
53
+ ingest.py format detection, code/SVG/frontmatter stripping, offset map
54
+ normalize.py neutralize numbers/dates/URLs/identifiers before scoring
55
+ analyzers/ pluggable analyzers (readability, passive, adverbs, complex_phrase)
56
+ aggregate.py merge spans, compute the document score
57
+ inputs.py files, folders, globs, stdin, and excludes
58
+ config.py papa.toml and [tool.papa]
59
+ reporters/ cli, concise, json, html
60
+ tests/ pytest suite (one file per area)
61
+ tests/ux/ eyes cases, corpora, reviewed snapshots
62
+ ```
63
+
64
+ The data flow is `Ingestor -> Analyzers -> Aggregator -> Reporters`. See `spec.md` for the full architecture.
65
+
66
+ ## Adding an analyzer
67
+
68
+ 1. Add a module under `src/papa/analyzers/` that returns a list of `Finding` objects.
69
+ 2. Register it in `src/papa/analyzers/__init__.py`.
70
+ 3. Add a test under `tests/`.
71
+ 4. Keep core heuristics small and dependency-light. Heavy linters belong as optional plugins.
72
+
73
+ ## Pull request checklist
74
+
75
+ - [ ] `pytest` passes locally.
76
+ - [ ] `eyes run` passes, and you reviewed any snapshot change.
77
+ - [ ] New behavior has a test.
78
+ - [ ] Public behavior changes are reflected in `README.md` or `spec.md`.
79
+ - [ ] Commit messages explain the why, not just the what.
80
+
81
+ ## Code style
82
+
83
+ - Minimal comments. Let names carry meaning.
84
+ - Match the patterns already in the file you are editing.
85
+ - No em dashes in prose files. Use a comma, a period, or rewrite.
86
+
87
+ ## Conduct
88
+
89
+ By participating you agree to the [Code of Conduct](CODE_OF_CONDUCT.md).
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2026 Bharadwaj Pendyala
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.