diff --git a/.github/workflows/dei.yml b/.github/workflows/dei.yml new file mode 100644 index 00000000..d0ab360b --- /dev/null +++ b/.github/workflows/dei.yml @@ -0,0 +1,48 @@ +name: DEI Checks +# whitelist +# master +# slave + +on: + push: + branches: [ main ] + pull_request: + branches: [ main ] + workflow_dispatch: + +env: + CARGO_TERM_COLOR: always + +jobs: + inclusive_language: + name: Check for inclusive language + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + - uses: get-woke/woke-action@v0 + with: + fail-on-error: true +# inclusive_language_warnings: +# name: List of non-inclusive language +# runs-on: ubuntu-latest +# steps: +# - uses: actions/checkout@v4 +# with: +# fetch-depth: 2 +# - name: Inclusiveness Analyzer +# uses: microsoft/InclusivenessAnalyzer@v1.0.1 +# with: +# excludeUnchangedFiles: false +# +# inclusive_language: +# name: Check for inclusive language +# runs-on: ubuntu-latest +# steps: +# - uses: actions/checkout@v4 +# with: +# fetch-depth: 2 +# - name: Inclusiveness Analyzer +# uses: microsoft/InclusivenessAnalyzer@v1.0.1 +# with: +# failOnNonInclusiveTerm: true +# excludeUnchangedFiles: false diff --git a/.woke.yml b/.woke.yml new file mode 100644 index 00000000..41b50fa7 --- /dev/null +++ b/.woke.yml @@ -0,0 +1,382 @@ +# Rules to use in addition to the defaults from https://github.com/get-woke/woke/blob/main/pkg/rule/default.yaml + +rules: + # These rules were pulled from https://github.com/microsoft/InclusivenessAnalyzer/blob/main/src/data.json; refer to + # the original file for alternatives when not provided. + # The default rules don't have `master`, only `master-slave` + - name: master + terms: + - master + alternatives: + - main + - primary + - leader + note: "See the following for other alternatives: https://github.com/microsoft/InclusivenessAnalyzer/blob/main/src/data.json" + options: + include_note: true + word_boundary: true + + - name: whitelist + terms: + - whitelist + - white-list + - white list + note: "See the following for other alternatives: https://github.com/microsoft/InclusivenessAnalyzer/blob/main/src/data.json" + options: + include_note: true + word_boundary: true + + - name: blacklist + terms: + - blacklist + - black-list + - black list + note: "See the following for other alternatives: https://github.com/microsoft/InclusivenessAnalyzer/blob/main/src/data.json" + options: + include_note: true + word_boundary: true + + - name: minority + terms: + - minority + - minorities + note: "See the following for other alternatives: https://github.com/microsoft/InclusivenessAnalyzer/blob/main/src/data.json" + options: + include_note: true + word_boundary: true + + - name: brown bag + terms: + - brown bag + - brownbag + - brown-bag + note: "See the following for other alternatives: https://github.com/microsoft/InclusivenessAnalyzer/blob/main/src/data.json" + options: + include_note: true + word_boundary: true + + - name: white box + terms: + - white box + - whitebox + - white-box + note: "See the following for other alternatives: https://github.com/microsoft/InclusivenessAnalyzer/blob/main/src/data.json" + options: + include_note: true + word_boundary: true + + - name: black box + terms: + - black box + - blackbox + - black-box + note: "See the following for other alternatives: https://github.com/microsoft/InclusivenessAnalyzer/blob/main/src/data.json" + options: + include_note: true + word_boundary: true + + - name: culture fit + terms: + - culture fit + note: "See the following for other alternatives: https://github.com/microsoft/InclusivenessAnalyzer/blob/main/src/data.json" + options: + include_note: true + word_boundary: true + + - name: citizen + terms: + - citizen + note: "See the following for other alternatives: https://github.com/microsoft/InclusivenessAnalyzer/blob/main/src/data.json" + options: + include_note: true + word_boundary: true + + - name: guys + terms: + - guys + alternatives: + - everyone + - all + - y'all + note: "See the following for other alternatives: https://github.com/microsoft/InclusivenessAnalyzer/blob/main/src/data.json" + options: + include_note: true + word_boundary: true + + - name: gender specific pronouns + terms: + - he + - him + - his + - she + - her + - hers + alternatives: + - they + - them + - theirs + note: "See the following for other alternatives: https://github.com/microsoft/InclusivenessAnalyzer/blob/main/src/data.json" + options: + include_note: true + word_boundary: true + + - name: manpower + terms: + - manpower + - man-power + - man power + note: "See the following for other alternatives: https://github.com/microsoft/InclusivenessAnalyzer/blob/main/src/data.json" + options: + include_note: true + word_boundary: true + + - name: man hours + terms: + - man hours + - man-hours + note: "See the following for other alternatives: https://github.com/microsoft/InclusivenessAnalyzer/blob/main/src/data.json" + options: + include_note: true + word_boundary: true + + - name: mankind + terms: + - mankind + - man kind + - man-kind + note: "See the following for other alternatives: https://github.com/microsoft/InclusivenessAnalyzer/blob/main/src/data.json" + options: + include_note: true + word_boundary: true + + - name: chairman + terms: + - chairman + - chair man + note: "See the following for other alternatives: https://github.com/microsoft/InclusivenessAnalyzer/blob/main/src/data.json" + options: + include_note: true + word_boundary: true + + - name: foreman + terms: + - foreman + note: "See the following for other alternatives: https://github.com/microsoft/InclusivenessAnalyzer/blob/main/src/data.json" + options: + include_note: true + word_boundary: true + + - name: middleman + terms: + - middleman + - middle man + - middle-man + note: "See the following for other alternatives: https://github.com/microsoft/InclusivenessAnalyzer/blob/main/src/data.json" + options: + include_note: true + word_boundary: true + + - name: mother + terms: + - mother + - mothering + note: "See the following for other alternatives: https://github.com/microsoft/InclusivenessAnalyzer/blob/main/src/data.json" + options: + include_note: true + word_boundary: true + + - name: father + terms: + - father + - fathering + note: "See the following for other alternatives: https://github.com/microsoft/InclusivenessAnalyzer/blob/main/src/data.json" + options: + include_note: true + word_boundary: true + + - name: gender specific partner terms + terms: + - wife + - husband + - boyfriend + - girlfriend + alternatives: + - partner + - spouse + - significant other + note: "See the following for other alternatives: https://github.com/microsoft/InclusivenessAnalyzer/blob/main/src/data.json" + options: + include_note: true + word_boundary: true + + - name: gender specific nouns + terms: + - girl + - girls + - female + - females + - boy + - boys + - male + - males + alternatives: + - person + - persons + - people + note: "See the following for other alternatives: https://github.com/microsoft/InclusivenessAnalyzer/blob/main/src/data.json" + options: + include_note: true + word_boundary: true + + - name: mom test + terms: + - mom test + note: "See the following for other alternatives: https://github.com/microsoft/InclusivenessAnalyzer/blob/main/src/data.json" + options: + include_note: true + word_boundary: true + + - name: girlfriend test + terms: + - girlfriend test + note: "See the following for other alternatives: https://github.com/microsoft/InclusivenessAnalyzer/blob/main/src/data.json" + options: + include_note: true + word_boundary: true + + - name: ninja + terms: + - ninja + note: "See the following for other alternatives: https://github.com/microsoft/InclusivenessAnalyzer/blob/main/src/data.json" + options: + include_note: true + word_boundary: true + + - name: rock star + terms: + - rock star + note: "See the following for other alternatives: https://github.com/microsoft/InclusivenessAnalyzer/blob/main/src/data.json" + options: + include_note: true + word_boundary: true + + - name: housekeeping + terms: + - housekeeping + note: "See the following for other alternatives: https://github.com/microsoft/InclusivenessAnalyzer/blob/main/src/data.json" + options: + include_note: true + word_boundary: true + + - name: opposite sex + terms: + - opposite sex + note: "See the following for other alternatives: https://github.com/microsoft/InclusivenessAnalyzer/blob/main/src/data.json" + options: + include_note: true + word_boundary: true + + - name: grandfathered in + terms: + - grandfathered in + - grandfathered + note: "See the following for other alternatives: https://github.com/microsoft/InclusivenessAnalyzer/blob/main/src/data.json" + options: + include_note: true + word_boundary: true + + - name: midget + terms: + - midget + note: "See the following for other alternatives: https://github.com/microsoft/InclusivenessAnalyzer/blob/main/src/data.json" + options: + include_note: true + word_boundary: true + + - name: sanity + terms: + - sanity + - crazy + - insane + - sane + - sanity check + note: "See the following for other alternatives: https://github.com/microsoft/InclusivenessAnalyzer/blob/main/src/data.json" + options: + include_note: true + word_boundary: true + + - name: freak + terms: + - freak + note: "See the following for other alternatives: https://github.com/microsoft/InclusivenessAnalyzer/blob/main/src/data.json" + options: + include_note: true + word_boundary: true + + - name: tone deaf + terms: + - tone deaf + note: "See the following for other alternatives: https://github.com/microsoft/InclusivenessAnalyzer/blob/main/src/data.json" + options: + include_note: true + word_boundary: true + + - name: blind spot + terms: + - blind spot + note: "See the following for other alternatives: https://github.com/microsoft/InclusivenessAnalyzer/blob/main/src/data.json" + options: + include_note: true + word_boundary: true + + - name: OCD + terms: + - OCD + note: "See the following for other alternatives: https://github.com/microsoft/InclusivenessAnalyzer/blob/main/src/data.json" + options: + include_note: true + word_boundary: true + + - name: depressed + terms: + - depressed + - depressing + note: "See the following for other alternatives: https://github.com/microsoft/InclusivenessAnalyzer/blob/main/src/data.json" + options: + include_note: true + word_boundary: true + + - name: handicap + terms: + - handicap + note: "See the following for other alternatives: https://github.com/microsoft/InclusivenessAnalyzer/blob/main/src/data.json" + options: + include_note: true + word_boundary: true + + - name: cripple + terms: + - cripple + note: "See the following for other alternatives: https://github.com/microsoft/InclusivenessAnalyzer/blob/main/src/data.json" + options: + include_note: true + word_boundary: true + + - name: retard + terms: + - retard + note: "See the following for other alternatives: https://github.com/microsoft/InclusivenessAnalyzer/blob/main/src/data.json" + options: + include_note: true + word_boundary: true + + - name: dummy + terms: + - dummy value + - dummy + alternatives: + - placeholder + note: "See the following for other alternatives: https://github.com/microsoft/InclusivenessAnalyzer/blob/main/src/data.json" + options: + include_note: true + word_boundary: true diff --git a/README.md b/README.md index e11e1d02..b082cb1e 100644 --- a/README.md +++ b/README.md @@ -27,7 +27,7 @@ and [Poem](https://github.com/poem-web/poem). boilerplate. Simply provide a [FunctionService](https://docs.rs/roadster/latest/roadster/service/function/service/struct.FunctionService.html) with your async function and register it in the `App#services` method. -- Provides sane defaults so you can focus on building your app, but most (all?) of the built-in behavior can be +- Provides sensible defaults so you can focus on building your app, but most (all?) of the built-in behavior can be customized or disabled via per-environment configuration files. - Uses `#![forbid(unsafe_code)]` to ensure all code in Roadster is 100% safe rust. - Provides a CLI for common commands, and allows consumers to provide their own CLI commands diff --git a/src/api/cli/mod.rs b/src/api/cli/mod.rs index b27ee913..fe8f2db1 100644 --- a/src/api/cli/mod.rs +++ b/src/api/cli/mod.rs @@ -159,10 +159,8 @@ mod tests { let args = if let Some(args) = args { args.split(' ').collect_vec() - } else if let Some(args) = arg_list { - args } else { - Default::default() + arg_list.unwrap_or_default() }; // The first word is interpreted as the binary name let args = vec!["binary_name"] diff --git a/src/lib.rs b/src/lib.rs index 79282dad..43d90a9c 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -6,7 +6,7 @@ //! //! - Built on Tokio's web stack (axum, tower, hyper, tracing). App behavior can be easily extended by taking advantage of //! all the resources in the tokio ecosystem. -//! - Provides sane defaults so you can focus on building your app. +//! - Provides sensible defaults so you can focus on building your app. //! - Most of the built-in behavior can be customized or even disabled via per-environment configuration files. //! - Uses `#![forbid(unsafe_code)]` to ensure all code in Roadster is 100% safe rust.