Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bump styler from 0.11.9 to 1.0.0 #30

Merged
merged 2 commits into from
Aug 14, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -94,15 +94,17 @@ defmodule TextChunker.Strategies.RecursiveChunk do
end
end)

if chunks != [],
do: chunks,
else: [
if chunks == [] do
[
%Chunk{
start_byte: 0,
end_byte: 1,
text: "incompatible_config_or_text_no_chunks_saved"
}
]
else
chunks
end
end

defp perform_split(text, separators, chunk_size, chunk_overlap) do
Expand Down
2 changes: 1 addition & 1 deletion mix.exs
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ defmodule TextChunker.MixProject do
# Run "mix help deps" to learn about dependencies.
defp deps do
[
{:styler, "~> 0.7", only: [:dev, :test], runtime: false},
{:styler, "~> 1.0", only: [:dev, :test], runtime: false},
{:ex_doc, "~> 0.29", only: [:dev, :test], runtime: false},
{:nimble_options, "~> 1.0"}
]
Expand Down
2 changes: 1 addition & 1 deletion mix.lock
Original file line number Diff line number Diff line change
Expand Up @@ -6,5 +6,5 @@
"makeup_erlang": {:hex, :makeup_erlang, "1.0.0", "6f0eff9c9c489f26b69b61440bf1b238d95badae49adac77973cbacae87e3c2e", [:mix], [{:makeup, "~> 1.0", [hex: :makeup, repo: "hexpm", optional: false]}], "hexpm", "ea7a9307de9d1548d2a72d299058d1fd2339e3d398560a0e46c27dab4891e4d2"},
"nimble_options": {:hex, :nimble_options, "1.1.1", "e3a492d54d85fc3fd7c5baf411d9d2852922f66e69476317787a7b2bb000a61b", [:mix], [], "hexpm", "821b2470ca9442c4b6984882fe9bb0389371b8ddec4d45a9504f00a66f650b44"},
"nimble_parsec": {:hex, :nimble_parsec, "1.4.0", "51f9b613ea62cfa97b25ccc2c1b4216e81df970acd8e16e8d1bdc58fef21370d", [:mix], [], "hexpm", "9c565862810fb383e9838c1dd2d7d2c437b3d13b267414ba6af33e50d2d1cf28"},
"styler": {:hex, :styler, "0.11.9", "2595393b94e660cd6e8b582876337cc50ff047d184ccbed42fdad2bfd5d78af5", [:mix], [], "hexpm", "8b7806ba1fdc94d0a75127c56875f91db89b75117fcc67572661010c13e1f259"},
"styler": {:hex, :styler, "1.0.0", "87daf4a8e421d7678da78f9532a632974de6b8060b80d7827abec3bca5140173", [:mix], [], "hexpm", "4ba5bc40c5eaebe2bb05ec0bb7b5a889d38c6ea6865c584dffd360b3a94ec625"},
}
16 changes: 8 additions & 8 deletions test/recursive_chunk_test.exs
Original file line number Diff line number Diff line change
Expand Up @@ -247,19 +247,19 @@ defmodule TextChunkerTest do

expected_result =
[
"class PetShop:\n \"\"\"Represents a pet shop with inventory and sales functionality.\"\"\"",
~s(class PetShop:\n """Represents a pet shop with inventory and sales functionality."""),
"\n\n def __init__(self, name):\n self.name = name\n self.inventory = {}",
"\n\n def add_pet(self, pet_type, quantity):",
"\n \"\"\"Adds a specified quantity of a pet type to the inventory.\"\"\"",
~s(\n """Adds a specified quantity of a pet type to the inventory."""),
"\n if pet_type in self.inventory:\n self.inventory[pet_type] += quantity",
"\n else:\n self.inventory[pet_type] = quantity",
"\n\n def sell_pet(self, pet_type, quantity):",
"\n \"\"\"Sells a specified quantity of a pet type.\"\"\"",
~s(\n """Sells a specified quantity of a pet type."""),
"\n if pet_type in self.inventory and self.inventory[pet_type] >= quantity:",
"\n self.inventory[pet_type] -= quantity\n return True\n else:",
"\n return False",
"\n\n def get_pet_count(self, pet_type):",
"\n \"\"\"Returns the current count of a specific pet type.\"\"\"",
~s(\n """Returns the current count of a specific pet type."""),
"\n return self.inventory.get(pet_type, 0)\n"
]

Expand All @@ -279,20 +279,20 @@ defmodule TextChunkerTest do

expected_result =
[
"class PetShop:\n \"\"\"Represents a pet shop with inventory and sales functionality.\"\"\"",
~s(class PetShop:\n """Represents a pet shop with inventory and sales functionality."""),
"\n\n def __init__(self, name):\n self.name = name\n self.inventory = {}",
"\n\n def add_pet(self, pet_type, quantity):",
"\n \"\"\"Adds a specified quantity of a pet type to the inventory.\"\"\"",
~s(\n """Adds a specified quantity of a pet type to the inventory."""),
"\n if pet_type in self.inventory:\n self.inventory[pet_type] += quantity",
"\n self.inventory[pet_type] += quantity\n else:",
"\n else:\n self.inventory[pet_type] = quantity",
"\n\n def sell_pet(self, pet_type, quantity):",
"\n def sell_pet(self, pet_type, quantity):\n \"\"\"Sells a specified quantity of a pet type.\"\"\"",
~s{\n def sell_pet(self, pet_type, quantity):\n """Sells a specified quantity of a pet type."""},
"\n if pet_type in self.inventory and self.inventory[pet_type] >= quantity:",
"\n self.inventory[pet_type] -= quantity\n return True\n else:",
"\n return True\n else:\n return False",
"\n\n def get_pet_count(self, pet_type):",
"\n \"\"\"Returns the current count of a specific pet type.\"\"\"",
~s(\n """Returns the current count of a specific pet type."""),
"\n return self.inventory.get(pet_type, 0)\n"
]

Expand Down
Loading