Giter Club home page Giter Club logo

jpoehnelt / in-solidarity-bot Goto Github PK

View Code? Open in Web Editor NEW
40.0 3.0 16.0 1.61 MB

An inclusive language GitHub App for detecting and suggesting changes to insensitive language in pull requests.

Home Page: https://github.com/jpoehnelt/in-solidarity-bot

License: Apache License 2.0

Dockerfile 1.87% JavaScript 5.98% TypeScript 89.68% Handlebars 2.47%
inclusive language blacklivesmatter everyone probot inclusive-language github-bot probot-app hactoberfest

in-solidarity-bot's Introduction

In Solidarity

Install Build Release codecov GitHub contributors semantic-release npm

A GitHub Bot built with Probot that checks for inclusive language. See our documentation for more information.

Install

The app can be installed at https://github.com/apps/in-solidarity.

Note: The checks currently run on public repositories. This helps limit permissions for organizations with many repositories.

Share this app with one of the following badges.

[![](https://github.com/jpoehnelt/in-solidarity-bot/raw/main/static//badge-flat.png)](https://github.com/apps/in-solidarity)

[![](https://github.com/jpoehnelt/in-solidarity-bot/raw/main/static//badge-flat-square.png)](https://github.com/apps/in-solidarity)

[![](https://github.com/jpoehnelt/in-solidarity-bot/raw/main/static//badge-for-the-badge.png)](https://github.com/apps/in-solidarity)

Documentation

Rules and configuration options are at ./docs/README.md.

Production

A hosted version of this app is available and a basic status page can be found at https://stats.uptimerobot.com/rX0A4iA75m.

Development

# Install dependencies
npm install

# Run typescript
npm run build

# Test
npm test  # npm test -- -u to update snapshots
npm run lint  # npm run format to fix issues

# Set appropriate .env values and run the bot
npm start

Contributing

Note: Additional rules are welcome and can be added in src/rules.ts.

If you have suggestions for how the bot could be improved, or want to report a bug, open an issue! We'd love all and any contributions.

For more, check out the Contributing Guide.

This is not an official Google product.

in-solidarity-bot's People

Contributors

dependabot[bot] avatar jefiozie avatar jpoehnelt avatar lowlydba avatar marsonya avatar semantic-release-bot avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

in-solidarity-bot's Issues

Open issues for terms existing in code

On push events to default branch, the app could check for rules violations and open issues to alert and better prioritize making changes.

Open questions:

  1. A single tracking issue for all rules or an issue per rule?
  2. GitHub code search does not support regex. Is cloning the repo the only path? Some repositories have many commits and are very large.

How do I add new terms? Custom terms?

I'd like to submit some new terms to the project.

I think I can figure out how to add default terms from reading the code. I'm not sure how to add .yml files though.

If it helps, I'd be happy to write or review documentation for this, but I think I'd need some help to figure out how. Maybe a pull request, or some very rough guidance?

Using _extends with .github repos

I was hoping that it would be possible to use a .github/in-solidarity.yml file inside an organization-wide .github repository, to have bot settings consistently applied across an org. That org-wide config file would contain _extends: ietf/terminology, to pick up the configuration from https://github.com/ietf/terminology/blob/main/.github/in-solidarity.yml.

That seems to fail, however, with an error that I don't know what to do about:

configuration is invalid: [
{
"instancePath": "",
"schemaPath": "#/additionalProperties",
"keyword": "additionalProperties",
"params": {
"additionalProperty": "_extends"
},
"message": "must NOT have additional properties"
}
]

Is this supposed to work? Am I doing this wrong somehow?

[Feature Request] Add support for i18n

Is your feature request related to a problem? Please describe.
As an international community, many developers write in human languages other than English, and they may want to make sure that they are writing code and documentation with inclusive language in their native language. For instance, many popular libraries and frameworks need help translating documentation, and if someone sees a community-translated docs page as non-inclusive, that will damage the public reputation of a community.
Describe the solution you'd like
I have a good idea for how to implement a rule-set fit for i18n. A better way to structure the rule-set is to structure it with the following type signature:

export type Rules = {
    lang: string, // example: 'es-MX'
    defaultMessage: string, // a mustache template
    rules: {
        regex: (string | RegExp)[],
        level: Level,
        alternatives?: string[],
        message?: string;
    }[]
}[]

A list of fallback locales could be exported to cover similar locales. The matching algorithm would use a similar process as the current matching algorithm.

Regarding configuration, a list of specific locales would need to be provided by the user somehow, so In Solidarity does not trigger a false-positive for a language the user is not looking for; after all, a combination of text in one language could set off a false alarm from a rule for a totally different language.

Describe alternatives you've considered
Sure, developers could provide several different rules in their own languages, but it could cause unexpected results.
Additional context
This idea was inspired by i18next.init({...}).

False positives in longer words

The word "manageable" (and derivatives of) hits the "man" filter. See this for example.

Many (another word that would hit this filter) words that are listed probably need to appear in their entirety to be considered problematic. Consider using "\b" to match on word boundaries for those words. That might reduce false positives.

Allow for configuration

A naive first attempt at a pattern configuration could be the following.

export interface Pattern {
  description: string;
  regex: RegExp[];
  suggestions: string[];
  level: 'notice' | 'warning'  | 'failure';  // OctoKit doesn't export these
}

export interface Configuration {
    patterns: ('default' | 'extended' | Pattern)[];
}  

The pattern level would then rollup to the check level.

if (notice || warning ) => check conclusion is neutral
if (failure ) => check conclusion is failure

Install as YAML-based workflow?

Would it be possible to enable this functionality by adding a YAML-based workflow to a repo, instead of needing to manually activate the bot for a repo?

The latter requires a manual step, while the former can be automated (we create and configure a lot of repos from scripts), and the manual step isn't scriptable.

Allow configuration for an entire org

Some orgs, like: GoogleAPIs & Google have a .github root repo for default configuration. It would be nice if in-solidarity-bot allowed configuration at the org level in addition to the repo level.

It would also be nice if it allowed configuration of wordlists and alternative suggestion.

The automated release is failing 🚨

🚨 The automated release from the main branch failed. 🚨

I recommend you give this issue a high priority, so other packages depending on you could benefit from your bug fixes and new features.

You can find below the list of errors reported by semantic-release. Each one of them has to be resolved in order to automatically publish your package. I’m sure you can resolve this πŸ’ͺ.

Errors are usually caused by a misconfiguration or an authentication problem. With each error reported below you will find explanation and guidance to help you to resolve it.

Once all the errors are resolved, semantic-release will release your package the next time you push a commit to the main branch. You can also manually restart the failed CI job that runs semantic-release.

If you are not sure how to resolve this, here is some links that can help you:

If those don’t help, or if this issue is reporting something you think isn’t right, you can always ask the humans behind semantic-release.


The release 1.4.1 on branch main cannot be published as it is out of range.

Based on the releases published on other branches, only versions within the range >=1.4.0 <1.4.1 can be published from branch main.

The following commit is responsible for the invalid release:

This commit should be moved to a valid branch with git merge or git cherry-pick and removed from branch main with git revert or git reset.

A valid branch could be beta.

See the workflow configuration documentation for more details.


Good luck with your project ✨

Your semantic-release bot πŸ“¦πŸš€

Support for error messages in the schema

It would be nice if the custom annotation in .yml files also supported custom error text, and/or a URL.

that would allow folks or companies to include messages that are tailored to their use cases, and link out to canonical style guides for reference.

iiic the current lint warning would say something like: "Please consider an alternative to blacklist."

It would be nice if we could supplement the text so that it could say something like:

"See the style guide for more information: https://developers.google.com/style/word-list#master"

Or possibly even inline the style guide text.

"Please consider an alternative to blacklist.
Don't use blacklist, whitelist, and graylist. Instead, use more precise terms that are appropriate for your domain. See the style guide for more information: https://developers.google.com/style/word-list#master"

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    πŸ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. πŸ“ŠπŸ“ˆπŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❀️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.