Skip to content

Commit 05ce48f

Browse files
[pre-commit.ci] pre-commit autoupdate (sloria#467)
* [pre-commit.ci] pre-commit autoupdate updates: - [github.com/astral-sh/ruff-pre-commit: v0.5.6 → v0.9.1](astral-sh/ruff-pre-commit@v0.5.6...v0.9.1) - [github.com/python-jsonschema/check-jsonschema: 0.29.1 → 0.31.0](python-jsonschema/check-jsonschema@0.29.1...0.31.0) - [github.com/asottile/blacken-docs: 1.18.0 → 1.19.1](adamchainz/blacken-docs@1.18.0...1.19.1) * [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci --------- Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com> Co-authored-by: Steven Loria <sloria1@gmail.com>
1 parent e2b3add commit 05ce48f

File tree

5 files changed

+14
-19
lines changed

5 files changed

+14
-19
lines changed

.pre-commit-config.yaml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,15 @@
11
repos:
22
- repo: https://github.com/astral-sh/ruff-pre-commit
3-
rev: v0.5.6
3+
rev: v0.9.1
44
hooks:
55
- id: ruff
66
- id: ruff-format
77
- repo: https://github.com/python-jsonschema/check-jsonschema
8-
rev: 0.29.1
8+
rev: 0.31.0
99
hooks:
1010
- id: check-github-workflows
1111
- repo: https://github.com/asottile/blacken-docs
12-
rev: 1.18.0
12+
rev: 1.19.1
1313
hooks:
1414
- id: blacken-docs
1515
additional_dependencies: [black==23.12.1]

src/textblob/classifiers.py

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -159,8 +159,7 @@ def _read_data(self, dataset, format=None):
159159
format_class = formats.detect(dataset)
160160
if not format_class:
161161
raise FormatError(
162-
"Could not automatically detect format for the given "
163-
"data source."
162+
"Could not automatically detect format for the given data source."
164163
)
165164
else:
166165
registry = formats.get_registry()
@@ -230,7 +229,7 @@ def classifier(self):
230229
return self.train()
231230
except AttributeError as error: # nltk_class has not been defined
232231
raise ValueError(
233-
"NLTKClassifier must have a nltk_class" " variable that is not None."
232+
"NLTKClassifier must have a nltk_class variable that is not None."
234233
) from error
235234

236235
def train(self, *args, **kwargs):
@@ -251,7 +250,7 @@ def train(self, *args, **kwargs):
251250
return self.classifier
252251
except AttributeError as error:
253252
raise ValueError(
254-
"NLTKClassifier must have a nltk_class" " variable that is not None."
253+
"NLTKClassifier must have a nltk_class variable that is not None."
255254
) from error
256255

257256
def labels(self):
@@ -298,7 +297,7 @@ def update(self, new_data, *args, **kwargs):
298297
)
299298
except AttributeError as error: # Descendant has not defined nltk_class
300299
raise ValueError(
301-
"NLTKClassifier must have a nltk_class" " variable that is not None."
300+
"NLTKClassifier must have a nltk_class variable that is not None."
302301
) from error
303302
return True
304303

tests/test_blob.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -388,7 +388,7 @@ def test_invalid_comparison(self):
388388

389389
def test_words(self):
390390
blob = tb.TextBlob(
391-
"Beautiful is better than ugly. " "Explicit is better than implicit."
391+
"Beautiful is better than ugly. Explicit is better than implicit."
392392
)
393393
assert isinstance(blob.words, tb.WordList)
394394
assert blob.words == tb.WordList(
@@ -418,7 +418,7 @@ def test_words_includes_apostrophes_in_contractions(self):
418418

419419
def test_pos_tags(self):
420420
blob = tb.TextBlob(
421-
"Simple is better than complex. " "Complex is better than complicated."
421+
"Simple is better than complex. Complex is better than complicated."
422422
)
423423
assert blob.pos_tags == [
424424
("Simple", "NN"),
@@ -664,7 +664,7 @@ def test_sentences_after_concatenation(self):
664664

665665
def test_sentiment(self):
666666
positive = tb.TextBlob(
667-
"This is the best, most amazing " "text-processing library ever!"
667+
"This is the best, most amazing text-processing library ever!"
668668
)
669669
assert positive.sentiment[0] > 0.0
670670
negative = tb.TextBlob("bad bad bitches that's my muthufuckin problem.")
@@ -722,7 +722,7 @@ def test_words_are_word_objects(self):
722722

723723
def test_words_have_pos_tags(self):
724724
blob = tb.TextBlob(
725-
"Simple is better than complex. " "Complex is better than complicated."
725+
"Simple is better than complex. Complex is better than complicated."
726726
)
727727
first_word, first_tag = blob.pos_tags[0]
728728
assert isinstance(first_word, tb.Word)

tests/test_classifiers.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -276,7 +276,7 @@ def setUp(self):
276276
"They lost the ball",
277277
"The game was intense",
278278
"The goalkeeper catched the ball",
279-
"The other team controlled the ball" "The ball went off the court",
279+
"The other team controlled the ballThe ball went off the court",
280280
"They had the ball for the whole game",
281281
]
282282

tests/test_taggers.py

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -12,9 +12,7 @@
1212

1313
class TestPatternTagger(unittest.TestCase):
1414
def setUp(self):
15-
self.text = (
16-
"Simple is better than complex. " "Complex is better than complicated."
17-
)
15+
self.text = "Simple is better than complex. Complex is better than complicated."
1816
self.tagger = textblob.taggers.PatternTagger()
1917

2018
def test_init(self):
@@ -43,9 +41,7 @@ def test_tag(self):
4341
@pytest.mark.numpy
4442
class TestNLTKTagger(unittest.TestCase):
4543
def setUp(self):
46-
self.text = (
47-
"Simple is better than complex. " "Complex is better than complicated."
48-
)
44+
self.text = "Simple is better than complex. Complex is better than complicated."
4945
self.tagger = textblob.taggers.NLTKTagger()
5046

5147
def test_tag(self):

0 commit comments

Comments
 (0)