Skip to content

Fix typos#5006

Closed
IvanIvanoff wants to merge 1 commit intomasterfrom
fix-typos
Closed

Fix typos#5006
IvanIvanoff wants to merge 1 commit intomasterfrom
fix-typos

Conversation

@IvanIvanoff
Copy link
Member

@IvanIvanoff IvanIvanoff commented Feb 18, 2026

Changes

Ticket

Checklist:

  • I have performed a self-review of my own code
  • I have made corresponding changes to the documentation
  • I have tried to find clearer solution before commenting hard-to-understand parts of code
  • I have added tests that prove my fix is effective or that my feature works

Summary by CodeRabbit

  • Documentation
    • Corrected spelling and grammar errors across documentation, comments, and error messages throughout the codebase for improved clarity and consistency.

@coderabbitai
Copy link

coderabbitai bot commented Feb 18, 2026

📝 Walkthrough

Walkthrough

This pull request contains a comprehensive cleanup of spelling, grammar, and formatting errors across the codebase. Changes include correcting typos like "succesfully" → "successfully," "accomodate" → "accommodate," and removing duplicate words from comments and documentation strings. No functional or control flow modifications are present.

Changes

Cohort / File(s) Summary
Spelling Corrections: "successfully" & "occurred"
lib/sanbase/alerts/evaluator/scheduler.ex, lib/sanbase/discord_bot/command_handler.ex, lib/sanbase/event_bus/event_emitter.ex, lib/sanbase/signal/signal.ex, lib/sanbase/utils/math.ex, lib/sanbase_web/controllers/telegram_controller.ex
Fixed common misspellings: "succesfully" → "successfully," "errror" → "error," "occured" → "occurred," "enviroment" → "environment."
Spelling Corrections: "accommodate"
lib/sanbase/menu/menus.ex, lib/sanbase_web/endpoint.ex, lib/sanbase_web/graphql/schema/queries/menu_queries.ex
Corrected "accomodate" → "accommodate" in documentation and comments.
Spelling Corrections: "coming"
lib/sanbase_web/graphql/cache/cache.ex, lib/sanbase_web/plug/basic_auth.ex, lib/sanbase_web/plug/bot_login_plug.ex, lib/sanbase_web/plug/telegram_match_plug.ex
Fixed "comming" → "coming" in module and function documentation.
Duplicate Word Removal
lib/sanbase/dashboards/dashboards.ex, lib/sanbase/external_services/coinmarketcap/ticker_fetcher.ex, lib/sanbase/metric/metric.ex, lib/sanbase_web/graphql/absinthe_before_send.ex, lib/sanbase_web/graphql/resolvers/file_resolver.ex, lib/sanbase_web/graphql/resolvers/project/project_transfers_resolver.ex, lib/sanbase_web/graphql/schema/types/project_types.ex
Removed duplicate words: "the the" → "the," "of of" → "of," "for for" → "for," "then then" → "then."
Grammar & Miscellaneous Fixes
lib/sanbase/queries/authorization.ex, lib/sanbase/transfers/eth_transfers.ex, lib/sanbase/utils/math.ex
Fixed grammar ("a hour" → "an hour"), spelling ("wheteher" → "whether," "predfined" → "predefined," "probablistic" → "probabilistic"), and descriptive clarity in docstrings.

Estimated code review effort

🎯 1 (Trivial) | ⏱️ ~3 minutes

Poem

🐰✨ Typos and doubled words, oh what a sight!
With careful hops, I've set them right.
"Succesfully" → "successfully"—no more shame,
A cleaner codebase is what I claim! 📝✨

🚥 Pre-merge checks | ✅ 2 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 77.78% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (2 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title 'Fix typos' accurately summarizes the main change in the pull request, which consists entirely of spelling and grammar corrections across 22 files with no functional changes.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
  • 📝 Generate docstrings
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch fix-typos

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

Copy link

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Caution

Some comments are outside the diff and can’t be posted inline due to platform limitations.

⚠️ Outside diff range comments (7)
lib/sanbase/menu/menus.ex (1)

247-247: ⚠️ Potential issue | 🟡 Minor

Remaining typo follwingfollowing in adjacent docstring.

✏️ Suggested fix
-  A menu item can have the follwing fields updated:
+  A menu item can have the following fields updated:
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@lib/sanbase/menu/menus.ex` at line 247, Fix the typo in the docstring that
reads "A menu item can have the follwing fields updated:" by changing "follwing"
to "following" in the docs inside lib/sanbase/menu/menus.ex (look for that exact
sentence in the module's docstring or function docs in Menus module) so the
sentence reads "A menu item can have the following fields updated:".
lib/sanbase/alerts/evaluator/scheduler.ex (1)

405-405: ⚠️ Potential issue | 🟡 Minor

Atom key total_sent_succesfully retains the original misspelling.

The comment on Line 381 was fixed, but the map key on Line 405 still reads :total_sent_succesfully. Since handle_send_results_list/2's callers only pattern-match on :last_triggered (Line 318), renaming this key is safe.

✏️ Suggested fix
-      total_sent_succesfully: total_triggered - total_failed,
+      total_sent_successfully: total_triggered - total_failed,
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@lib/sanbase/alerts/evaluator/scheduler.ex` at line 405, The map returned in
handle_send_results_list/2 still uses the misspelled atom key
:total_sent_succesfully; update that key to the correct :total_sent_successfully
wherever it's set (currently in the map with total_sent_succesfully:
total_triggered - total_failed) and ensure any internal references in the same
module use the corrected atom; callers only pattern-match :last_triggered so
this rename is safe.
lib/sanbase/external_services/coinmarketcap/ticker_fetcher.ex (1)

174-183: ⚠️ Potential issue | 🔴 Critical

Pre-existing bug: BTC validation failure incorrectly nullifies :price_usd instead of :price_btc.

When Validator.valid_price?/3 returns {:error, _} for the "BTC" price, the code sets :price_usd to nil (Line 181). The equivalent USD block on Lines 164–172 correctly sets :price_usd. The BTC block should mirror it by setting :price_btc. The current code silently discards a valid USD price and retains an invalid BTC price, allowing it to pass the filter on Line 186.

🐛 Proposed fix
          {:error, error} ->
            Logger.info("[CMC] Price validation failed: #{inspect(error)}")
-           Map.put(t, :price_usd, nil)
+           Map.put(t, :price_btc, nil)
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@lib/sanbase/external_services/coinmarketcap/ticker_fetcher.ex` around lines
174 - 183, The BTC price validation block (the then -> case using
Validator.valid_price?/3) incorrectly nullifies :price_usd on failure; change
the failure branch to set :price_btc to nil (i.e., replace the Map.put(t,
:price_usd, nil) call with one that sets :price_btc), keeping the Logger.info
call and the surrounding then/case structure intact so a failed BTC validation
removes the BTC value rather than the USD value.
lib/sanbase_web/graphql/resolvers/file_resolver.ex (1)

54-54: ⚠️ Potential issue | 🟡 Minor

Remaining typo resposeresponse in nearby comment.

Line 54 still reads "query respose" and was not caught in this pass.

✏️ Suggested fix
-  # in the query respose to propagate the error.
+  # in the query response to propagate the error.
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@lib/sanbase_web/graphql/resolvers/file_resolver.ex` at line 54, Fix the typo
in the comment inside file_resolver.ex: change "query respose" to "query
response" so the comment reads correctly; locate the comment near the
module/file name FileResolver (or the file_resolver.ex comment block around the
query handling code) and update that single word while leaving the rest of the
comment unchanged.
lib/sanbase/discord_bot/command_handler.ex (2)

432-432: ⚠️ Potential issue | 🟡 Minor

Missed typo in user-visible embed string: "reactiing" → "reacting".

Since this PR is specifically targeting typos, this user-facing string was overlooked.

✏️ Proposed fix
-          "<@#{to_string(msg.author.id)}> I am still learning and improving, please let me know how I did by reactiing below"
+          "<@#{to_string(msg.author.id)}> I am still learning and improving, please let me know how I did by reacting below"
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@lib/sanbase/discord_bot/command_handler.ex` at line 432, Fix the user-facing
typo in the reply string inside lib/sanbase/discord_bot/command_handler.ex:
change "reactiing" to "reacting" in the message that mentions
"<@#{to_string(msg.author.id)}> I am still learning and improving, please let me
know how I did by reactiing below" so the visible text reads "reacting". Locate
the string used where the bot builds the reply (referencing msg.author.id) and
update the spelled word only.

623-623: ⚠️ Potential issue | 🟡 Minor

Likely numeric typo: weeks: -14 should be weeks: -2 for "last 2 weeks".

14 weeks (~3.5 months) does not match the label. This clause also appears to be unreachable today since the autocomplete offers "2 weeks ago" rather than "last 2 weeks", but the value itself is incorrect regardless.

🐛 Proposed fix
-  defp text_to_datetime("last 2 weeks"), do: Timex.shift(DateTime.utc_now(), weeks: -14)
+  defp text_to_datetime("last 2 weeks"), do: Timex.shift(DateTime.utc_now(), weeks: -2)
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@lib/sanbase/discord_bot/command_handler.ex` at line 623, In the
text_to_datetime function, fix the numeric typo in the clause matching "last 2
weeks": replace the incorrect Timex.shift(DateTime.utc_now(), weeks: -14) with
Timex.shift(DateTime.utc_now(), weeks: -2) so the returned datetime range
matches the "last 2 weeks" label (this is the clause in text_to_datetime/1 that
currently uses weeks: -14).
lib/sanbase_web/graphql/absinthe_before_send.ex (1)

443-444: ⚠️ Potential issue | 🟡 Minor

Dead code: line 443 map literal is never used.

%{success: success, error: error} on line 443 evaluates to a map but the result is immediately discarded. The function returns line 444's value. This looks like a refactoring artifact where line 443 was supposed to be replaced, not kept alongside line 444.

🧹 Proposed fix
-    %{success: success, error: error}
     %{success: rename_mapper.(success), error: rename_mapper.(error)}
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@lib/sanbase_web/graphql/absinthe_before_send.ex` around lines 443 - 444,
Remove the dead map literal `%{success: success, error: error}` that is
immediately discarded and return only the transformed map `%{success:
rename_mapper.(success), error: rename_mapper.(error)}`; locate the surrounding
code that builds the success/error maps (references: rename_mapper, success,
error) and delete the unused `%{success: success, error: error}` expression so
the function returns the renamed values without the redundant artifact.
🧹 Nitpick comments (5)
lib/sanbase/signal/signal.ex (1)

138-141: LGTM! Both occurrences of "occurred" correctly spelled. One additional nit nearby: line 163 has "an selector" which should be "a selector".

✏️ Suggested cleanup
-  Get the aggregated value for a signal, an selector and time range.
+  Get the aggregated value for a signal, a selector and time range.
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@lib/sanbase/signal/signal.ex` around lines 138 - 141, The docs contain the
grammatical typo "an selector" which should be "a selector"; locate the phrase
in lib/sanbase/signal/signal.ex (near the docblock surrounding the
signal-related functions) and replace "an selector" with "a selector" to fix the
article usage in the documentation string.
lib/sanbase_web/plug/basic_auth.ex (1)

3-5: LGTM! "coming" correctly spelled. Separately, the moduledoc text describing a Telegram path check appears to belong to TelegramMatchPlug rather than BasicAuth — likely a copy/paste artefact predating this PR, but worth correcting in a follow-up.

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@lib/sanbase_web/plug/basic_auth.ex` around lines 3 - 5, The moduledoc in
BasicAuth currently describes a Telegram path check that belongs to
TelegramMatchPlug; update the documentation for the BasicAuth module (module
name BasicAuth in lib/sanbase_web/plug/basic_auth.ex) to describe basic HTTP
auth behavior or move the Telegram-specific paragraph to the TelegramMatchPlug
module (module name TelegramMatchPlug) so each module's moduledoc matches its
responsibility and remove the misplaced Telegram wording from BasicAuth.
lib/sanbase/event_bus/event_emitter.ex (1)

61-62: LGTM! "environment" correctly spelled. One more nit remains on line 69: "subcribers""subscribers".

✏️ Suggested cleanup
-            # sleep after the event is emitted so there's time for the subcribers
+            # sleep after the event is emitted so there's time for the subscribers
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@lib/sanbase/event_bus/event_emitter.ex` around lines 61 - 62, Fix the typo in
the module comment inside lib/sanbase/event_bus/event_emitter.ex: replace
"subcribers" with "subscribers" in the comment near the EventEmitter module so
the documentation reads correctly (look for the comment block referencing test
environment and subscribers handling the event).
lib/sanbase_web/graphql/cache/cache.ex (1)

4-6: A few more typos remain in this file worth cleaning up while you're here.

  • Line 4: "precalculating itt""precalculating it"
  • Line 41: "Absinthe.Middlewar.Async""Absinthe.Middleware.Async" (missing e)
  • Line 221: "from withing""from within"
✏️ Suggested cleanup
-  caches the result of the resolver for a some time instead of precalculating itt
+  caches the result of the resolver for a some time instead of precalculating it
-  3. Handle the `Absinthe.Middlewar.Async` and `Absinthe.Middleware.Dataloader`
+  3. Handle the `Absinthe.Middleware.Async` and `Absinthe.Middleware.Dataloader`
-  # `cache_modify_middleware` is called only from withing `get_or_store` that
+  # `cache_modify_middleware` is called only from within `get_or_store` that
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@lib/sanbase_web/graphql/cache/cache.ex` around lines 4 - 6, Fix the remaining
typos in the cache module: update the module doc string that currently reads
"precalculating itt" to "precalculating it", correct the misspelled middleware
reference "Absinthe.Middlewar.Async" to "Absinthe.Middleware.Async" (so any
alias/require/use or string references match the real module), and change the
phrase "from withing" to "from within" wherever it appears (e.g., in docs or
error messages inside the Cache module). Locate these in the Cache module
(module name Cache or file cache.ex) and update the three strings to their
corrected spellings.
lib/sanbase_web/graphql/schema/types/project_types.ex (1)

434-434: LGTM! Duplicate "the" correctly removed. Two additional doc nits remain nearby:

  • Line 420: "Provides liqudity""Provides liquidity"
  • Line 754: "for a ERC20 project""for an ERC20 project"
✏️ Suggested cleanup
-    - Provides liqudity and DeFi integrations
+    - Provides liquidity and DeFi integrations
-    `@desc` "Average daily active addresses for a ERC20 project or Ethereum and given time period"
+    `@desc` "Average daily active addresses for an ERC20 project or Ethereum and given time period"
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@lib/sanbase_web/graphql/schema/types/project_types.ex` at line 434, In
lib/sanbase_web/graphql/schema/types/project_types.ex (module ProjectTypes), fix
two docstring typos: replace the string "Provides liqudity" with "Provides
liquidity" and replace "for a ERC20 project" with "for an ERC20 project"
wherever those descriptions appear (likely in the Project GraphQL type field
descriptions); update the text in-place so the schema docs/readme reflect the
corrected wording.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Outside diff comments:
In `@lib/sanbase_web/graphql/absinthe_before_send.ex`:
- Around line 443-444: Remove the dead map literal `%{success: success, error:
error}` that is immediately discarded and return only the transformed map
`%{success: rename_mapper.(success), error: rename_mapper.(error)}`; locate the
surrounding code that builds the success/error maps (references: rename_mapper,
success, error) and delete the unused `%{success: success, error: error}`
expression so the function returns the renamed values without the redundant
artifact.

In `@lib/sanbase_web/graphql/resolvers/file_resolver.ex`:
- Line 54: Fix the typo in the comment inside file_resolver.ex: change "query
respose" to "query response" so the comment reads correctly; locate the comment
near the module/file name FileResolver (or the file_resolver.ex comment block
around the query handling code) and update that single word while leaving the
rest of the comment unchanged.

In `@lib/sanbase/alerts/evaluator/scheduler.ex`:
- Line 405: The map returned in handle_send_results_list/2 still uses the
misspelled atom key :total_sent_succesfully; update that key to the correct
:total_sent_successfully wherever it's set (currently in the map with
total_sent_succesfully: total_triggered - total_failed) and ensure any internal
references in the same module use the corrected atom; callers only pattern-match
:last_triggered so this rename is safe.

In `@lib/sanbase/discord_bot/command_handler.ex`:
- Line 432: Fix the user-facing typo in the reply string inside
lib/sanbase/discord_bot/command_handler.ex: change "reactiing" to "reacting" in
the message that mentions "<@#{to_string(msg.author.id)}> I am still learning
and improving, please let me know how I did by reactiing below" so the visible
text reads "reacting". Locate the string used where the bot builds the reply
(referencing msg.author.id) and update the spelled word only.
- Line 623: In the text_to_datetime function, fix the numeric typo in the clause
matching "last 2 weeks": replace the incorrect Timex.shift(DateTime.utc_now(),
weeks: -14) with Timex.shift(DateTime.utc_now(), weeks: -2) so the returned
datetime range matches the "last 2 weeks" label (this is the clause in
text_to_datetime/1 that currently uses weeks: -14).

In `@lib/sanbase/external_services/coinmarketcap/ticker_fetcher.ex`:
- Around line 174-183: The BTC price validation block (the then -> case using
Validator.valid_price?/3) incorrectly nullifies :price_usd on failure; change
the failure branch to set :price_btc to nil (i.e., replace the Map.put(t,
:price_usd, nil) call with one that sets :price_btc), keeping the Logger.info
call and the surrounding then/case structure intact so a failed BTC validation
removes the BTC value rather than the USD value.

In `@lib/sanbase/menu/menus.ex`:
- Line 247: Fix the typo in the docstring that reads "A menu item can have the
follwing fields updated:" by changing "follwing" to "following" in the docs
inside lib/sanbase/menu/menus.ex (look for that exact sentence in the module's
docstring or function docs in Menus module) so the sentence reads "A menu item
can have the following fields updated:".

---

Nitpick comments:
In `@lib/sanbase_web/graphql/cache/cache.ex`:
- Around line 4-6: Fix the remaining typos in the cache module: update the
module doc string that currently reads "precalculating itt" to "precalculating
it", correct the misspelled middleware reference "Absinthe.Middlewar.Async" to
"Absinthe.Middleware.Async" (so any alias/require/use or string references match
the real module), and change the phrase "from withing" to "from within" wherever
it appears (e.g., in docs or error messages inside the Cache module). Locate
these in the Cache module (module name Cache or file cache.ex) and update the
three strings to their corrected spellings.

In `@lib/sanbase_web/graphql/schema/types/project_types.ex`:
- Line 434: In lib/sanbase_web/graphql/schema/types/project_types.ex (module
ProjectTypes), fix two docstring typos: replace the string "Provides liqudity"
with "Provides liquidity" and replace "for a ERC20 project" with "for an ERC20
project" wherever those descriptions appear (likely in the Project GraphQL type
field descriptions); update the text in-place so the schema docs/readme reflect
the corrected wording.

In `@lib/sanbase_web/plug/basic_auth.ex`:
- Around line 3-5: The moduledoc in BasicAuth currently describes a Telegram
path check that belongs to TelegramMatchPlug; update the documentation for the
BasicAuth module (module name BasicAuth in lib/sanbase_web/plug/basic_auth.ex)
to describe basic HTTP auth behavior or move the Telegram-specific paragraph to
the TelegramMatchPlug module (module name TelegramMatchPlug) so each module's
moduledoc matches its responsibility and remove the misplaced Telegram wording
from BasicAuth.

In `@lib/sanbase/event_bus/event_emitter.ex`:
- Around line 61-62: Fix the typo in the module comment inside
lib/sanbase/event_bus/event_emitter.ex: replace "subcribers" with "subscribers"
in the comment near the EventEmitter module so the documentation reads correctly
(look for the comment block referencing test environment and subscribers
handling the event).

In `@lib/sanbase/signal/signal.ex`:
- Around line 138-141: The docs contain the grammatical typo "an selector" which
should be "a selector"; locate the phrase in lib/sanbase/signal/signal.ex (near
the docblock surrounding the signal-related functions) and replace "an selector"
with "a selector" to fix the article usage in the documentation string.

@IvanIvanoff
Copy link
Member Author

Close in favor of #5007

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant

Comments