refactor: cspell configuration (#11146)

* fix: cspell ignore weird IPFS url

* fix: cspell ignore filecoin f410f addresses

* chore: write ignore in single line

* feat: configure everything in `cspell.json`

* refactor: remove unnecessary cspell ignores

* refactor: cspell run command in actions and devcontainer

* chore: enable editor support

* chore: add comment

* fix: cspell action options

* feat: run for all files
pull/7739/merge
Fedor Ivanov 2 weeks ago committed by GitHub
parent 18eb3c6fb2
commit 6dbdb26b35
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
  1. 2
      .devcontainer/bin/bs
  2. 6
      .github/workflows/config.yml
  3. 1
      apps/block_scout_web/test/block_scout_web/views/nft_helper_test.exs
  4. 1
      apps/explorer/priv/repo/migrations/20230815131151_drop_logs_address_hash_foreign_key.exs
  5. 1
      apps/explorer/priv/repo/migrations/20230816061723_drop_token_transfers_and_transactions_address_foreign_key.exs
  6. 1
      apps/explorer/priv/repo/migrations/20230817061317_drop_address_foreign_keys.exs
  7. 1
      apps/explorer/priv/repo/migrations/20230821120625_drop_rest_address_foreign_keys.exs
  8. 1
      apps/explorer/priv/repo/migrations/20230831122819_drop_current_token_balances_tokens_foreign_key.exs
  9. 1
      apps/explorer/priv/repo/migrations/20230905085809_drop_token_balances_tokens_foreign_key.exs
  10. 17
      cspell.json

@ -146,7 +146,7 @@ recompile() {
# Define the spellcheck subroutine
spellcheck() {
cspell --config cspell.json "**/*.ex*" "**/*.eex" "**/*.js" --gitignore | less
cspell | less
}
# Define the dialyzer subroutine

@ -366,10 +366,8 @@ jobs:
- name: Run cspell
uses: streetsidesoftware/cspell-action@v6
with:
files: |
**/*.ex*
**/*.eex
**/*.js"
use_cspell_files: true
incremental_files_only: false
eslint:
name: ESLint

@ -12,6 +12,7 @@ defmodule BlockScoutWeb.NFTHelperTest do
end
test "transforms ipfs link like ipfs://ipfs" do
# cspell:disable-next-line
url = "ipfs://ipfs/Qmbgk4Ps5kiVdeYCHufMFgqzWLFuovFRtenY5P8m9vr9XW/animation.mp4"
assert "https://ipfs.io/ipfs/Qmbgk4Ps5kiVdeYCHufMFgqzWLFuovFRtenY5P8m9vr9XW/animation.mp4" ==

@ -1,4 +1,3 @@
# cspell:ignore fkey
defmodule Explorer.Repo.Migrations.DropLogsAddressHashForeignKey do
use Ecto.Migration

@ -1,4 +1,3 @@
# cspell:ignore fkey
defmodule Explorer.Repo.Migrations.DropTokenTransfersAndTransactionsAddressForeignKey do
use Ecto.Migration

@ -1,4 +1,3 @@
# cspell:ignore fkey
defmodule Explorer.Repo.Migrations.DropAddressForeignKeys do
use Ecto.Migration

@ -1,4 +1,3 @@
# cspell:ignore fkey
defmodule Explorer.Repo.Migrations.DropRestAddressForeignKeys do
use Ecto.Migration

@ -1,4 +1,3 @@
# cspell:ignore fkey
defmodule Explorer.Repo.Migrations.DropCurrentTokenBalancesTokensForeignKey do
use Ecto.Migration

@ -1,4 +1,3 @@
# cspell:ignore fkey
defmodule Explorer.Repo.Migrations.DropTokenBalancesTokensForeignKey do
use Ecto.Migration

@ -1,13 +1,28 @@
// cSpell Settings
{
"$schema": "https://raw.githubusercontent.com/streetsidesoftware/cspell/main/cspell.schema.json",
// Version of the setting file. Always 0.2
"version": "0.2",
// language - current active spelling language
"language": "en",
// enabled - enable code editor suggestions
"enabled": true,
// files - glob patterns of files to be checked
"files": [
"**/*.ex*",
"**/*.eex",
"**/*.js"
],
// useGitignore - use .gitignore to exclude files from checking
"useGitignore": true,
// words - list of words to be always considered correct
"ignorePaths": [
"apps/block_scout_web/assets/js/lib/ace/src-min/*.js"
],
"ignoreRegExpList": [
// Ignore filecoin f410f-like native addresses
"f410f[a-z2-7]{39}"
],
"words": [
"aave",
"absname",
@ -653,5 +668,5 @@
"dotenv",
"html-eex",
"makefile"
]
],
}

Loading…
Cancel
Save