onesentence 0.0.3__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 (37) hide show
  1. onesentence-0.0.3/.github/dependabot.yml +25 -0
  2. onesentence-0.0.3/.github/release-drafter.yml +21 -0
  3. onesentence-0.0.3/.github/workflows/draft-release.yml +23 -0
  4. onesentence-0.0.3/.github/workflows/publish-pypi.yml +33 -0
  5. onesentence-0.0.3/.github/workflows/run-tests.yml +51 -0
  6. onesentence-0.0.3/.gitignore +171 -0
  7. onesentence-0.0.3/.pre-commit-config.yaml +66 -0
  8. onesentence-0.0.3/.pre-commit-hooks.yaml +17 -0
  9. onesentence-0.0.3/CITATION.cff +24 -0
  10. onesentence-0.0.3/CODE_OF_CONDUCT.md +132 -0
  11. onesentence-0.0.3/CONTRIBUTING.md +128 -0
  12. onesentence-0.0.3/LICENSE +28 -0
  13. onesentence-0.0.3/PKG-INFO +64 -0
  14. onesentence-0.0.3/README.md +47 -0
  15. onesentence-0.0.3/pyproject.toml +37 -0
  16. onesentence-0.0.3/reports/coverage/coverage-badge.svg +1 -0
  17. onesentence-0.0.3/setup.cfg +4 -0
  18. onesentence-0.0.3/src/onesentence/__init__.py +5 -0
  19. onesentence-0.0.3/src/onesentence/analyze.py +135 -0
  20. onesentence-0.0.3/src/onesentence/cli.py +46 -0
  21. onesentence-0.0.3/src/onesentence.egg-info/PKG-INFO +64 -0
  22. onesentence-0.0.3/src/onesentence.egg-info/SOURCES.txt +35 -0
  23. onesentence-0.0.3/src/onesentence.egg-info/dependency_links.txt +1 -0
  24. onesentence-0.0.3/src/onesentence.egg-info/entry_points.txt +2 -0
  25. onesentence-0.0.3/src/onesentence.egg-info/requires.txt +2 -0
  26. onesentence-0.0.3/src/onesentence.egg-info/top_level.txt +1 -0
  27. onesentence-0.0.3/tests/__init__.py +0 -0
  28. onesentence-0.0.3/tests/data/1_true_pos.md +36 -0
  29. onesentence-0.0.3/tests/data/1_true_pos_fixed.md +44 -0
  30. onesentence-0.0.3/tests/data/2_true_neg.md +51 -0
  31. onesentence-0.0.3/tests/data/3_true_pos.rst +40 -0
  32. onesentence-0.0.3/tests/data/3_true_pos_fixed.rst +48 -0
  33. onesentence-0.0.3/tests/data/4_true_neg.rst +54 -0
  34. onesentence-0.0.3/tests/test_cli.py +75 -0
  35. onesentence-0.0.3/tests/test_utils.py +67 -0
  36. onesentence-0.0.3/tests/utils.py +20 -0
  37. onesentence-0.0.3/uv.lock +365 -0
@@ -0,0 +1,25 @@
1
+ # GitHub Dependabot configuration
2
+ # Note: there is no interaction between this
3
+ # configuration and dependabot security updates.
4
+ # See here for more information:
5
+ # https://docs.github.com/en/code-security/dependabot/dependabot-security-updates/about-dependabot-security-updates#about-dependabot-security-updates
6
+
7
+ version: 2
8
+ updates:
9
+ # GitHub Actions checks
10
+ # See here for more information:
11
+ # https://docs.github.com/en/code-security/dependabot/dependabot-version-updates/configuring-dependabot-version-updates
12
+ - package-ecosystem: "github-actions"
13
+ directory: "/"
14
+ schedule:
15
+ # Check for updates to GitHub Actions every week
16
+ interval: "weekly"
17
+
18
+ # Perform checks and updates for python poetry environment.
19
+ # See here for more information:
20
+ # https://docs.github.com/en/code-security/dependabot/dependabot-version-updates/configuration-options-for-the-dependabot.yml-file#pip-and-pip-compile
21
+ - package-ecosystem: "pip"
22
+ directory: "/"
23
+ schedule:
24
+ # Check for updates to poetry lockfile every week
25
+ interval: "weekly"
@@ -0,0 +1,21 @@
1
+ ---
2
+ # template configuration for release-drafter
3
+ # see: https://github.com/release-drafter/release-drafter
4
+ name-template: 'v$RESOLVED_VERSION'
5
+ tag-template: 'v$RESOLVED_VERSION'
6
+ version-resolver:
7
+ major:
8
+ labels:
9
+ - 'release-major'
10
+ minor:
11
+ labels:
12
+ - 'release-minor'
13
+ patch:
14
+ labels:
15
+ - 'release-patch'
16
+ default: patch
17
+ change-template: '- $TITLE (@$AUTHOR via #$NUMBER)'
18
+ template: |
19
+ ## Changes
20
+
21
+ $CHANGES
@@ -0,0 +1,23 @@
1
+ ---
2
+ # workflow for drafting releases on GitHub
3
+ # see: https://github.com/release-drafter/release-drafter
4
+ name: release drafter
5
+
6
+ on:
7
+ push:
8
+ branches:
9
+ - main
10
+
11
+ jobs:
12
+ draft_release:
13
+ permissions:
14
+ # write permission is required to create a github release
15
+ contents: write
16
+ # write permission is required for autolabeler
17
+ # otherwise, read permission is required at least
18
+ pull-requests: write
19
+ runs-on: ubuntu-latest
20
+ steps:
21
+ - uses: release-drafter/release-drafter@v6
22
+ env:
23
+ GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
@@ -0,0 +1,33 @@
1
+ ---
2
+ # used for publishing packages to pypi on release
3
+ name: publish pypi release
4
+
5
+ on:
6
+ release:
7
+ types:
8
+ - published
9
+
10
+ jobs:
11
+ publish_pypi:
12
+ runs-on: ubuntu-latest
13
+ environment: release
14
+ permissions:
15
+ # IMPORTANT: this permission is mandatory for trusted publishing
16
+ id-token: write
17
+ steps:
18
+ - name: Checkout
19
+ uses: actions/checkout@v4
20
+ with:
21
+ fetch-depth: 0
22
+ - name: Fetch tags
23
+ run: git fetch --all --tags
24
+ - name: Python setup
25
+ uses: actions/setup-python@v5
26
+ with:
27
+ python-version: "3.11"
28
+ - name: Install the latest version of uv
29
+ uses: astral-sh/setup-uv@v6
30
+ - name: uv build distribution content
31
+ run: uv build
32
+ - name: Publish package distributions to PyPI
33
+ uses: pypa/gh-action-pypi-publish@release/v1
@@ -0,0 +1,51 @@
1
+ ---
2
+ # used for running tests
3
+ name: tests
4
+
5
+ on:
6
+ push:
7
+ branches: [main]
8
+ pull_request:
9
+ branches: [main]
10
+
11
+ jobs:
12
+ pre_commit_checks:
13
+ runs-on: ubuntu-22.04
14
+ steps:
15
+ # checks out the repo
16
+ - uses: actions/checkout@v4
17
+ # run pre-commit
18
+ - name: Python setup
19
+ uses: actions/setup-python@v5
20
+ with:
21
+ python-version: "3.11"
22
+ - name: Install the latest version of uv
23
+ uses: astral-sh/setup-uv@v6
24
+ - uses: pre-commit/action@v3.0.1
25
+ # run pre-commit ci lite for automated fixes
26
+ - uses: pre-commit-ci/lite-action@v1.1.0
27
+ if: ${{ !cancelled() }}
28
+ # Test that the hooks from `pre-commit-hooks.yaml`
29
+ # are working as expected.
30
+ - name: run local hook
31
+ run: |
32
+ pre-commit try-repo . --all
33
+ run_tests:
34
+ strategy:
35
+ matrix:
36
+ python_version: ["3.9", "3.10", "3.11", "3.12", "3.13"]
37
+ os: [ubuntu-22.04, macos-14]
38
+ runs-on: ${{ matrix.os }}
39
+ env:
40
+ OS: ${{ matrix.os }}
41
+ steps:
42
+ - name: Checkout
43
+ uses: actions/checkout@v4
44
+ - name: Python setup
45
+ uses: actions/setup-python@v5
46
+ with:
47
+ python-version: ${{ matrix.python_version }}
48
+ - name: Install the latest version of uv
49
+ uses: astral-sh/setup-uv@v6
50
+ - name: Run pytest
51
+ run: uv run --frozen pytest
@@ -0,0 +1,171 @@
1
+ # Byte-compiled / optimized / DLL files
2
+ __pycache__/
3
+ *.py[cod]
4
+ *$py.class
5
+
6
+ # C extensions
7
+ *.so
8
+
9
+ # Distribution / packaging
10
+ .Python
11
+ build/
12
+ develop-eggs/
13
+ dist/
14
+ downloads/
15
+ eggs/
16
+ .eggs/
17
+ lib/
18
+ lib64/
19
+ parts/
20
+ sdist/
21
+ var/
22
+ wheels/
23
+ share/python-wheels/
24
+ *.egg-info/
25
+ .installed.cfg
26
+ *.egg
27
+ MANIFEST
28
+
29
+ # PyInstaller
30
+ # Usually these files are written by a python script from a template
31
+ # before PyInstaller builds the exe, so as to inject date/other infos into it.
32
+ *.manifest
33
+ *.spec
34
+
35
+ # Installer logs
36
+ pip-log.txt
37
+ pip-delete-this-directory.txt
38
+
39
+ # Unit test / coverage reports
40
+ htmlcov/
41
+ .tox/
42
+ .nox/
43
+ .coverage
44
+ .coverage.*
45
+ .cache
46
+ nosetests.xml
47
+ coverage.xml
48
+ *.cover
49
+ *.py,cover
50
+ .hypothesis/
51
+ .pytest_cache/
52
+ cover/
53
+
54
+ # Translations
55
+ *.mo
56
+ *.pot
57
+
58
+ # Django stuff:
59
+ *.log
60
+ local_settings.py
61
+ db.sqlite3
62
+ db.sqlite3-journal
63
+
64
+ # Flask stuff:
65
+ instance/
66
+ .webassets-cache
67
+
68
+ # Scrapy stuff:
69
+ .scrapy
70
+
71
+ # Sphinx documentation
72
+ docs/_build/
73
+
74
+ # PyBuilder
75
+ .pybuilder/
76
+ target/
77
+
78
+ # Jupyter Notebook
79
+ .ipynb_checkpoints
80
+
81
+ # IPython
82
+ profile_default/
83
+ ipython_config.py
84
+
85
+ # pyenv
86
+ # For a library or package, you might want to ignore these files since the code is
87
+ # intended to run in multiple environments; otherwise, check them in:
88
+ # .python-version
89
+
90
+ # pipenv
91
+ # According to pypa/pipenv#598, it is recommended to include Pipfile.lock in version control.
92
+ # However, in case of collaboration, if having platform-specific dependencies or dependencies
93
+ # having no cross-platform support, pipenv may install dependencies that don't work, or not
94
+ # install all needed dependencies.
95
+ #Pipfile.lock
96
+
97
+ # UV
98
+ # Similar to Pipfile.lock, it is generally recommended to include uv.lock in version control.
99
+ # This is especially recommended for binary packages to ensure reproducibility, and is more
100
+ # commonly ignored for libraries.
101
+ #uv.lock
102
+
103
+ # poetry
104
+ # Similar to Pipfile.lock, it is generally recommended to include poetry.lock in version control.
105
+ # This is especially recommended for binary packages to ensure reproducibility, and is more
106
+ # commonly ignored for libraries.
107
+ # https://python-poetry.org/docs/basic-usage/#commit-your-poetrylock-file-to-version-control
108
+ #poetry.lock
109
+
110
+ # pdm
111
+ # Similar to Pipfile.lock, it is generally recommended to include pdm.lock in version control.
112
+ #pdm.lock
113
+ # pdm stores project-wide configurations in .pdm.toml, but it is recommended to not include it
114
+ # in version control.
115
+ # https://pdm.fming.dev/latest/usage/project/#working-with-version-control
116
+ .pdm.toml
117
+ .pdm-python
118
+ .pdm-build/
119
+
120
+ # PEP 582; used by e.g. github.com/David-OConnor/pyflow and github.com/pdm-project/pdm
121
+ __pypackages__/
122
+
123
+ # Celery stuff
124
+ celerybeat-schedule
125
+ celerybeat.pid
126
+
127
+ # SageMath parsed files
128
+ *.sage.py
129
+
130
+ # Environments
131
+ .env
132
+ .venv
133
+ env/
134
+ venv/
135
+ ENV/
136
+ env.bak/
137
+ venv.bak/
138
+
139
+ # Spyder project settings
140
+ .spyderproject
141
+ .spyproject
142
+
143
+ # Rope project settings
144
+ .ropeproject
145
+
146
+ # mkdocs documentation
147
+ /site
148
+
149
+ # mypy
150
+ .mypy_cache/
151
+ .dmypy.json
152
+ dmypy.json
153
+
154
+ # Pyre type checker
155
+ .pyre/
156
+
157
+ # pytype static type analyzer
158
+ .pytype/
159
+
160
+ # Cython debug symbols
161
+ cython_debug/
162
+
163
+ # PyCharm
164
+ # JetBrains specific template is maintained in a separate JetBrains.gitignore that can
165
+ # be found at https://github.com/github/gitignore/blob/main/Global/JetBrains.gitignore
166
+ # and can be added to the global gitignore or merged into this file. For a more nuclear
167
+ # option (not recommended) you can uncomment the following to ignore the entire idea folder.
168
+ #.idea/
169
+
170
+ # PyPI configuration file
171
+ .pypirc
@@ -0,0 +1,66 @@
1
+ # See https://pre-commit.com for more information
2
+ # See https://pre-commit.com/hooks.html for more hooks
3
+ default_language_version:
4
+ python: python3.11
5
+ repos:
6
+ - repo: https://github.com/pre-commit/pre-commit-hooks
7
+ rev: v5.0.0
8
+ hooks:
9
+ - id: trailing-whitespace
10
+ - id: end-of-file-fixer
11
+ exclude: |
12
+ (?x)^(
13
+ .*\.svg
14
+ )$
15
+ - id: check-yaml
16
+ - id: check-added-large-files
17
+ - id: detect-private-key
18
+ - repo: https://gitlab.com/vojko.pribudic.foss/pre-commit-update
19
+ rev: v0.6.0
20
+ hooks:
21
+ - id: pre-commit-update
22
+ args: ["--keep", "mdformat", "--keep", "pre-commit-update"]
23
+
24
+ - repo: https://github.com/tox-dev/pyproject-fmt
25
+ rev: "v2.6.0"
26
+ hooks:
27
+ - id: pyproject-fmt
28
+ - repo: https://github.com/codespell-project/codespell
29
+ rev: v2.4.1
30
+ hooks:
31
+ - id: codespell
32
+ exclude: |
33
+ (?x)^(
34
+ .*\.lock
35
+ )$
36
+ - repo: https://github.com/executablebooks/mdformat
37
+ rev: 0.7.18
38
+ hooks:
39
+ - id: mdformat
40
+ additional_dependencies:
41
+ - mdformat-gfm
42
+ exclude: ^tests/data/
43
+ - repo: https://github.com/rhysd/actionlint
44
+ rev: v1.7.7
45
+ hooks:
46
+ - id: actionlint
47
+ - repo: local
48
+ hooks:
49
+ - id: code-cov-gen
50
+ name: Generate code coverage
51
+ language: system
52
+ # freeze the environment so it does not update
53
+ # and only runs tests for coverage analysis
54
+ entry: uv run --frozen coverage run -m pytest
55
+ pass_filenames: false
56
+ always_run: true
57
+ - repo: https://github.com/Weird-Sheep-Labs/coverage-pre-commit
58
+ rev: 0.1.1
59
+ hooks:
60
+ - id: coverage-xml
61
+ - id: coverage-badge
62
+ args:
63
+ - "-i"
64
+ - "reports/coverage/coverage.xml"
65
+ - "-o"
66
+ - "reports/coverage/coverage-badge.svg"
@@ -0,0 +1,17 @@
1
+ # hooks for pre-commit
2
+ # check
3
+ - id: check
4
+ name: One Sentence Per Line Check
5
+ description: Check if each line in the given file contains only one sentence.
6
+ entry: onesentence check
7
+ language: python
8
+ types: [text, markdown, rst]
9
+ files: \.(md|rst|txt)$
10
+ # fix
11
+ - id: fix
12
+ name: One Sentence Per Line Fix
13
+ description: Fix files to ensure each line contains only one sentence.
14
+ entry: onesentence fix
15
+ language: python
16
+ types: [text, markdown, rst]
17
+ files: \.(md|rst|txt)$
@@ -0,0 +1,24 @@
1
+ # This CITATION.cff file was generated with cffinit.
2
+ # Visit https://bit.ly/cffinit to generate yours today!
3
+ ---
4
+ cff-version: 1.2.0
5
+ title: onesentence
6
+ message: >-
7
+ If you use this software, please cite it using the
8
+ metadata from the CITATION.cff file.
9
+ type: software
10
+ authors:
11
+ - given-names: David
12
+ family-names: Bunten
13
+ orcid: "https://orcid.org/0000-0001-6041-3665"
14
+ repository-code: "https://github.com/CU-DBMI/onesentence"
15
+ abstract: >-
16
+ A Pre-commit hook for checking 'one sentence per line' documentation practices.
17
+ keywords:
18
+ - python
19
+ - documentation
20
+ - style
21
+ - one-sentence-per-line
22
+ - formatter
23
+ - linting
24
+ license: BSD-3-Clause
@@ -0,0 +1,132 @@
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, socioeconomic status,
9
+ nationality, personal appearance, race, caste, color, religion, or sexual
10
+ identity and 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 for our
18
+ community include:
19
+
20
+ - Demonstrating empathy and kindness toward other people
21
+ - Being respectful of differing opinions, viewpoints, and experiences
22
+ - Giving and gracefully accepting constructive feedback
23
+ - Accepting responsibility and apologizing to those affected by our mistakes,
24
+ and learning from the experience
25
+ - Focusing on what is best not just for us as individuals, but for the overall
26
+ community
27
+
28
+ Examples of unacceptable behavior include:
29
+
30
+ - The use of sexualized language or imagery, and sexual attention or advances of
31
+ any kind
32
+ - Trolling, insulting or derogatory comments, and personal or political attacks
33
+ - Public or private harassment
34
+ - Publishing others' private information, such as a physical or email address,
35
+ without their explicit permission
36
+ - Other conduct which could reasonably be considered inappropriate in a
37
+ professional setting
38
+
39
+ ## Enforcement Responsibilities
40
+
41
+ Community leaders are responsible for clarifying and enforcing our standards of
42
+ acceptable behavior and will take appropriate and fair corrective action in
43
+ response to any behavior that they deem inappropriate, threatening, offensive,
44
+ or harmful.
45
+
46
+ Community leaders have the right and responsibility to remove, edit, or reject
47
+ comments, commits, code, wiki edits, issues, and other contributions that are
48
+ not aligned to this Code of Conduct, and will communicate reasons for moderation
49
+ decisions when appropriate.
50
+
51
+ ## Scope
52
+
53
+ This Code of Conduct applies within all community spaces, and also applies when
54
+ an individual is officially representing the community in public spaces.
55
+ Examples of representing our community include using an official email address,
56
+ posting via an official social media account, or acting as an appointed
57
+ representative at an online or offline event.
58
+
59
+ ## Enforcement
60
+
61
+ Instances of abusive, harassing, or otherwise unacceptable behavior may be
62
+ reported to community leaders responsible for enforcement.
63
+ Please reach out to the maintainers of this repository by using their GitHub profile email address contact information to privately notify us of any incidents of this nature.
64
+ All complaints will be reviewed and investigated promptly and fairly.
65
+
66
+ All community leaders are obligated to respect the privacy and security of the
67
+ reporter of any incident.
68
+
69
+ ## Enforcement Guidelines
70
+
71
+ Community leaders will follow these Community Impact Guidelines in determining
72
+ the consequences for any action they deem in violation of this Code of Conduct:
73
+
74
+ ### 1. Correction
75
+
76
+ **Community Impact**: Use of inappropriate language or other behavior deemed
77
+ unprofessional or unwelcome in the community.
78
+
79
+ **Consequence**: A private, written warning from community leaders, providing
80
+ clarity around the nature of the violation and an explanation of why the
81
+ behavior was inappropriate. A public apology may be requested.
82
+
83
+ ### 2. Warning
84
+
85
+ **Community Impact**: A violation through a single incident or series of
86
+ actions.
87
+
88
+ **Consequence**: A warning with consequences for continued behavior. No
89
+ interaction with the people involved, including unsolicited interaction with
90
+ those enforcing the Code of Conduct, for a specified period of time. This
91
+ includes avoiding interactions in community spaces as well as external channels
92
+ like social media. Violating these terms may lead to a temporary or permanent
93
+ ban.
94
+
95
+ ### 3. Temporary Ban
96
+
97
+ **Community Impact**: A serious violation of community standards, including
98
+ sustained inappropriate behavior.
99
+
100
+ **Consequence**: A temporary ban from any sort of interaction or public
101
+ communication with the community for a specified period of time. No public or
102
+ private interaction with the people involved, including unsolicited interaction
103
+ with those enforcing the Code of Conduct, is allowed during this period.
104
+ Violating these terms may lead to a permanent ban.
105
+
106
+ ### 4. Permanent Ban
107
+
108
+ **Community Impact**: Demonstrating a pattern of violation of community
109
+ standards, including sustained inappropriate behavior, harassment of an
110
+ individual, or aggression toward or disparagement of classes of individuals.
111
+
112
+ **Consequence**: A permanent ban from any sort of public interaction within the
113
+ community.
114
+
115
+ ## Attribution
116
+
117
+ This Code of Conduct is adapted from the [Contributor Covenant][homepage],
118
+ version 2.1, available at
119
+ [https://www.contributor-covenant.org/version/2/1/code_of_conduct.html][v2.1].
120
+
121
+ Community Impact Guidelines were inspired by
122
+ [Mozilla's code of conduct enforcement ladder][mozilla coc].
123
+
124
+ For answers to common questions about this code of conduct, see the FAQ at
125
+ [https://www.contributor-covenant.org/faq][faq]. Translations are available at
126
+ [https://www.contributor-covenant.org/translations][translations].
127
+
128
+ [faq]: https://www.contributor-covenant.org/faq
129
+ [homepage]: https://www.contributor-covenant.org
130
+ [mozilla coc]: https://github.com/mozilla/diversity
131
+ [translations]: https://www.contributor-covenant.org/translations
132
+ [v2.1]: https://www.contributor-covenant.org/version/2/1/code_of_conduct.html