Skip to content

Commit 4b6a969

Browse files
Merge pull request #482 from afuetterer/pre-commit
chore: set up initial pre-commit hooks
2 parents 361cc9d + c9d66be commit 4b6a969

10 files changed

Lines changed: 37 additions & 12 deletions

File tree

.github/FUNDING.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
# These are supported funding model platforms
22

3-
github: chrismattmann
3+
github: chrismattmann
44
custom: ["https://www.paypal.me/MattmannAI", "https://venmo.com/Chris-Mattmann"]

.github/workflows/ci.yml

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,16 @@ on:
77
pull_request:
88

99
jobs:
10+
lint:
11+
runs-on: ubuntu-slim
12+
steps:
13+
- uses: actions/checkout@v6
14+
- uses: actions/setup-python@v6
15+
with:
16+
python-version: "3.14"
17+
# Ref: https://github.com/tox-dev/action-pre-commit-uv
18+
- uses: tox-dev/action-pre-commit-uv@246b66536e366bb885f52d61983bf32f7c95e8b1 # 1.0.3
19+
1020
test:
1121
runs-on: ${{ matrix.os }}
1222
strategy:

.pre-commit-config.yaml

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
# pre-commit
2+
# Ref: https://pre-commit.com/#usage
3+
# ------------------------------------------------------------------------------
4+
5+
default_language_version:
6+
python: '3.14'
7+
8+
repos:
9+
- repo: https://github.com/pre-commit/pre-commit-hooks
10+
rev: 3e8a8703264a2f4a69428a0aa4dcb512790b2c8c # frozen: v6.0.0
11+
hooks:
12+
- id: check-merge-conflict
13+
- id: check-case-conflict
14+
- id: check-ast
15+
- id: debug-statements
16+
- id: check-toml
17+
- id: check-yaml
18+
- id: end-of-file-fixer
19+
exclude_types: [csv]
20+
- id: trailing-whitespace

docs/source/readme.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,4 +2,4 @@ README.md
22
==========
33

44
.. include:: ../../README.md
5-
:parser: myst_parser.sphinx_
5+
:parser: myst_parser.sphinx_

tests/conftest.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,4 +8,3 @@
88
@pytest.fixture
99
def test_file_path():
1010
return Path(__file__).parent / "files" / "rwservlet.pdf"
11-

tests/test_parser.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,4 +42,3 @@ def test_local_buffer():
4242
def test_local_path(test_file_path):
4343
"""parse file path"""
4444
assert parser.from_file(str(test_file_path))
45-

tests/test_prep.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
Tika
22
Tika supports dozens of document types. Each should be tested when extended
33
Client applications manage event streams, so test stream type/doc type combinations
4-
4+
55
Document types
66
pdf - http://www.fns.usda.gov/sites/default/files/snap/2014-SNAP-Retailer-Management-Annual-Report.pdf
77
pdf - http://dcra.dc.gov/sites/default/files/dc/sites/dcra/publication/attachments/ai_NuisanceAbatement.pdf

tika/config.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,4 +25,3 @@ def getMimeTypes():
2525

2626
def getDetectors():
2727
return getConfig('detectors')[1]
28-

tika/tika.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -903,4 +903,3 @@ def main(argv=None):
903903
else:
904904
out.write(resp)
905905
out.write('\n')
906-

tika/translate.py

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1313
# See the License for the specific language governing permissions and
1414
# limitations under the License.
15-
#
15+
#
1616

1717
from .tika import ServerEndpoint, Translator, callServer, doTranslate1
1818

@@ -38,7 +38,7 @@ def from_buffer(string, srcLang, destLang, serverEndpoint=ServerEndpoint, reques
3838
:param serverEndpoint:
3939
:return:
4040
'''
41-
status, response = callServer('put', ServerEndpoint, '/translate/all/'+Translator+'/'+srcLang+'/'+destLang,
41+
status, response = callServer('put', ServerEndpoint, '/translate/all/'+Translator+'/'+srcLang+'/'+destLang,
4242
string, {'Accept': 'text/plain'}, False, requestOptions=requestOptions)
4343
return response
4444

@@ -51,7 +51,7 @@ def auto_from_file(filename, destLang, serverEndpoint=ServerEndpoint, requestOpt
5151
:return:
5252
'''
5353
jsonOutput = doTranslate1(destLang, filename, serverEndpoint, requestOptions=requestOptions)
54-
return jsonOutput[1]
54+
return jsonOutput[1]
5555

5656
def auto_from_buffer(string, destLang, serverEndpoint=ServerEndpoint, requestOptions={}):
5757
'''
@@ -61,7 +61,6 @@ def auto_from_buffer(string, destLang, serverEndpoint=ServerEndpoint, requestOpt
6161
:param serverEndpoint: Tika server end point (Optional)
6262
:return:
6363
'''
64-
status, response = callServer('put', ServerEndpoint, '/translate/all/'+Translator+'/'+destLang,
64+
status, response = callServer('put', ServerEndpoint, '/translate/all/'+Translator+'/'+destLang,
6565
string, {'Accept': 'text/plain'}, False, requestOptions=requestOptions)
6666
return response
67-

0 commit comments

Comments
 (0)