Skip to content

Commit

Permalink
refactor: cspell configuration (blockscout#11146)
Browse files Browse the repository at this point in the history
* 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
  • Loading branch information
fedor-ivn authored Nov 6, 2024
1 parent 18eb3c6 commit 6dbdb26
Show file tree
Hide file tree
Showing 10 changed files with 20 additions and 12 deletions.
2 changes: 1 addition & 1 deletion .devcontainer/bin/bs
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
6 changes: 2 additions & 4 deletions .github/workflows/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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" ==
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
# cspell:ignore fkey
defmodule Explorer.Repo.Migrations.DropLogsAddressHashForeignKey do
use Ecto.Migration

Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
# cspell:ignore fkey
defmodule Explorer.Repo.Migrations.DropTokenTransfersAndTransactionsAddressForeignKey do
use Ecto.Migration

Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
# cspell:ignore fkey
defmodule Explorer.Repo.Migrations.DropAddressForeignKeys do
use Ecto.Migration

Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
# cspell:ignore fkey
defmodule Explorer.Repo.Migrations.DropRestAddressForeignKeys do
use Ecto.Migration

Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
# cspell:ignore fkey
defmodule Explorer.Repo.Migrations.DropCurrentTokenBalancesTokensForeignKey do
use Ecto.Migration

Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
# cspell:ignore fkey
defmodule Explorer.Repo.Migrations.DropTokenBalancesTokensForeignKey do
use Ecto.Migration

Expand Down
17 changes: 16 additions & 1 deletion cspell.json
Original file line number Diff line number Diff line change
@@ -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",
Expand Down Expand Up @@ -653,5 +668,5 @@
"dotenv",
"html-eex",
"makefile"
]
],
}

0 comments on commit 6dbdb26

Please sign in to comment.