Skip to content

Commit

Permalink
Merge pull request #62 from epage/typos
Browse files Browse the repository at this point in the history
chore(ci): Verify more things
  • Loading branch information
Muscraft authored Nov 9, 2023
2 parents 7fe7ce9 + e4e731c commit 5bea668
Show file tree
Hide file tree
Showing 7 changed files with 100 additions and 3 deletions.
24 changes: 24 additions & 0 deletions .github/workflows/committed.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
# Not run as part of pre-commit checks because they don't handle sending the correct commit
# range to `committed`
name: Lint Commits
on: [pull_request]

permissions:
contents: read

env:
RUST_BACKTRACE: 1
CARGO_TERM_COLOR: always
CLICOLOR: 1

jobs:
committed:
name: Lint Commits
runs-on: ubuntu-latest
steps:
- name: Checkout Actions Repository
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Lint Commits
uses: crate-ci/committed@master
23 changes: 23 additions & 0 deletions .github/workflows/pre-commit.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
name: pre-commit

permissions: {} # none

on:
pull_request:
push:
branches: [main]

env:
RUST_BACKTRACE: 1
CARGO_TERM_COLOR: always
CLICOLOR: 1

jobs:
pre-commit:
permissions:
contents: read
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v4
- uses: pre-commit/[email protected]
21 changes: 21 additions & 0 deletions .github/workflows/spelling.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
name: Spelling

permissions:
contents: read

on: [pull_request]

env:
RUST_BACKTRACE: 1
CARGO_TERM_COLOR: always
CLICOLOR: 1

jobs:
spelling:
name: Spell Check with Typos
runs-on: ubuntu-latest
steps:
- name: Checkout Actions Repository
uses: actions/checkout@v4
- name: Spell Check Repo
uses: crate-ci/typos@master
26 changes: 26 additions & 0 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
repos:
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v4.5.0
hooks:
- id: check-yaml
stages: [commit]
- id: check-json
stages: [commit]
- id: check-toml
stages: [commit]
- id: check-merge-conflict
stages: [commit]
- id: check-case-conflict
stages: [commit]
- id: detect-private-key
stages: [commit]
- repo: https://github.com/crate-ci/typos
rev: v1.16.20
hooks:
- id: typos
stages: [commit]
- repo: https://github.com/crate-ci/committed
rev: v1.0.20
hooks:
- id: committed
stages: [commit-msg]
3 changes: 3 additions & 0 deletions committed.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
style="conventional"
ignore_author_re="(dependabot|renovate)"
merge_commit = false
4 changes: 2 additions & 2 deletions src/display_list/structs.rs
Original file line number Diff line number Diff line change
Expand Up @@ -225,7 +225,7 @@ pub enum DisplayRawLine<'a> {
source_aligned: bool,
/// If set to `true`, only the label of the `Annotation` will be
/// displayed. It allows for a multiline annotation to be aligned
/// without displaing the meta information (`type` and `id`) to be
/// without displaying the meta information (`type` and `id`) to be
/// displayed on each line.
continuation: bool,
},
Expand Down Expand Up @@ -283,7 +283,7 @@ pub enum DisplayMarkType {
/// There are several ways to uses this information when formatting the `DisplayList`:
///
/// * An annotation may display the name of the type like `error` or `info`.
/// * An underline for `Error` may be `^^^` while for `Warning` it coule be `---`.
/// * An underline for `Error` may be `^^^` while for `Warning` it could be `---`.
/// * `ColorStylesheet` may use different colors for different annotations.
#[derive(Debug, Clone, PartialEq)]
pub enum DisplayAnnotationType {
Expand Down
2 changes: 1 addition & 1 deletion tests/formatter.rs
Original file line number Diff line number Diff line change
Expand Up @@ -513,7 +513,7 @@ fn test_raw_origin_initial_pos_anon_lines() {
header_type: DisplayHeaderType::Initial,
})]);

// Using anonymized_line_numbers should not affect the inital position
// Using anonymized_line_numbers should not affect the initial position
dl.anonymized_line_numbers = true;
assert_eq!(dl.to_string(), "--> src/test.rs:23:15");
}
Expand Down

0 comments on commit 5bea668

Please sign in to comment.