Skip to content

Commit 0ef1d6a

Browse files
authored
Add typos workflow (#8713)
* Add typos workflow * Add _typos.toml config for false positives * Fix reported typos
1 parent 36ac258 commit 0ef1d6a

File tree

7 files changed

+42
-7
lines changed

7 files changed

+42
-7
lines changed

.github/workflows/typos.yml

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
name: Typos
2+
3+
on:
4+
pull_request:
5+
6+
jobs:
7+
typos:
8+
name: Run typos
9+
runs-on: ubuntu-latest
10+
steps:
11+
- uses: actions/checkout@v4
12+
- uses: reviewdog/action-typos@v1
13+
with:
14+
fail_level: any
15+
filter_mode: nofilter # added (default), diff_context, file, nofilter
16+
github_token: ${{ secrets.GITHUB_TOKEN }}
17+
reporter: github-pr-check

UPGRADING.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -188,7 +188,7 @@ Note that `@post` can also be used here but make sure to call `authorize!` on it
188188

189189
### Localization Updates
190190

191-
This release includes several locale changes. Please [reivew the en.yml locale](https://github.com/activeadmin/activeadmin/blob/master/config/locales/en.yml) for the latest translations.
191+
This release includes several locale changes. Please [review the en.yml locale](https://github.com/activeadmin/activeadmin/blob/master/config/locales/en.yml) for the latest translations.
192192

193193
- The `dashboard_welcome`, `dropdown_actions`, `main_content` and `unsupported_browser` keys have been removed.
194194
- The `active_admin.pagination` keys have been rewritten to be less verbose and include new entries: next and previous.

_typos.toml

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
# https://github.com/crate-ci/typos#false-positives
2+
[default]
3+
extend-ignore-identifiers-re = [
4+
"succesfully_destroyed"
5+
]
6+
7+
[default.extend-identifiers]
8+
9+
[default.extend-words]
10+
rememberable = "rememberable"
11+
12+
[files]
13+
extend-exclude = [
14+
"config/locales/*",
15+
"!config/locales/en*.yml",
16+
"features/step_definitions/batch_action_steps.rb",
17+
"vendor/*"
18+
]

docs/4-csv-format.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ ActiveAdmin.register Post do
1515
csv do
1616
column :title
1717
column(:author) { |post| post.author.full_name }
18-
column('bODY', humanize_name: false) # preserve case
18+
column('body', humanize_name: false) # preserves case of column title
1919
end
2020
end
2121
```

features/index/filters.feature

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -31,9 +31,9 @@ Feature: Index Filtering
3131
filter :title
3232
end
3333
"""
34-
When I fill in "Title" with "<script>alert('hax')</script>"
34+
When I fill in "Title" with "<script>alert('hack')</script>"
3535
And I press "Filter"
36-
Then I should see current filter "title_cont" equal to "<script>alert('hax')</script>" with label "Title contains"
36+
Then I should see current filter "title_cont" equal to "<script>alert('hack')</script>" with label "Title contains"
3737

3838
Scenario: Filtering posts with no results
3939
Given 3 posts exist

lib/active_admin/filters/active.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ class Active
1111
# @param resource [ActiveAdmin::Resource] current resource
1212
# @param search [Ransack::Search] search object
1313
#
14-
# @see ActiveAdmin::ResourceController::DataAcces#apply_filtering
14+
# @see ActiveAdmin::ResourceController::DataAccess#apply_filtering
1515
def initialize(resource, search)
1616
@resource = resource
1717
@filters = build_filters(search.conditions)

spec/unit/views/components/attributes_table_spec.rb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -65,9 +65,9 @@
6565
end
6666
end
6767
},
68-
}.each do |context_title, table_decleration|
68+
}.each do |context_title, table_declaration|
6969
context context_title do
70-
let(:table) { instance_eval(&table_decleration) }
70+
let(:table) { instance_eval(&table_declaration) }
7171

7272
it "should render a div wrapper with the class '.attributes-table'" do
7373
expect(table.tag_name).to eq "div"

0 commit comments

Comments
 (0)