Drive Continuous Higher Standards with CodeLingo's Automated Reviews, Bug Fixes and Docs!
CodeLingo finds and fixes issues in existing code and ensures the same issues don't sneak in with new pull requests. CodeLingo also generates your contributor docs thus automating three cornerstones (bug fixing, reviewing and doc updates) to scale up your code quality.
@CodeLingoBot fixes bugs, automates code reviews and updates contributor docs for repos on GitHub based on rules, called Rules, defined in codelingo.yaml files. There are several ways you can interact with @CodeLingoBot. The simplest is to trigger actions by commenting on a Pull Request:
-
@CodeLingoBot review
reviews the PR based on default Rules for the repo's language or custom Rules added in a codelingo.yaml file in the root of the repo.You can trigger CodeLingo actions by replying to comments generated by
@review
@CodeLingoBot review ignore [reason]
ignores the issue for current and future reviews with an optional reason why.@CodeLingoBot review un-ignore
un-ignores the issue for current and future reviews.
-
@CodeLingoBot rewrite
makes a PR to this PR fixing the issues found based on default Rules for the repo's language or custom Rules added in a codelingo.yaml file in the root of the repo.You can trigger CodeLingo actions by replying to comments generated by
@rewrite
@CodeLingoBot rewrite set <varname>
sets the value of a variable in a rewrite template.
To have @CodeLingoBot automatically review every new Pull Request to your repo, install CodeLingo on your repo. If you don't already have a codelingo.yaml file, @CodeLingoBot will make a PR to add one to your repo. This will contain a bundle of Rules based on the languages in your repo.
Every pull request to your repository will now be checked against the go Rule bundle we imported above:
Let @CodeLingoBot know what Rules you'd like it to enforce by adding or removing them from codelingo.yaml. You can find Rules to add using the CodeLingo Dashboard. For example, if we wanted to install the "go" bundle written by "codelingo" we'd update the codelingo.yaml as follows:
# codelingo.yaml file
rules:
- import: codelingo/go
The rest of this README is for users interested in writing their own Rules and testing out CodeLingo on repositories on their local machine.
The Rule bundles that are rendered on codelingo.io/Rules are populated by the Rules in the Rules directory in this repository. Contributing a new Rule is simply a matter of making a PR to this repo. We're a young community of Rule authors eager to help and guide you through your first PR.
Get started with the docs and find us at codelingo.slack.com!
Each Rule has a query
, written in CLQL, to match a pattern. The online playground is a quick way to test and learn CLQL. It has a box of source code next to a box of CLQL. Select the source code and the playground will automatically generate the CLQL to match that selection!
Before we get into writing Rules, we want to ensure we can run and test them locally. For this, we're going to use the lingo CLI tool to run a review on our local machine. First, install the lingo CLI and set it up with the following commands:
# Run this command from anywhere. Follow the prompts to set up Codelingo on your machine.
$ lingo config setup
# Run this command inside a git repository to add a default codelingo.yaml file in the current directory.
$ lingo init
Replace the content of the codelingo.yaml file we wrote above with:
rules:
- import: codelingo/go
You can now run the review to check your source code against the go Rule bundle we imported above.
# Run this command from the same directory as the codelingo.yaml file or any of its sub directories.
$ lingo run review
Visit your CodeLingo Dashboard
You now have the tools setup to start writing your own Rules! See the getting started guide to learn more about Rules and how to write them.
- codelingo.io/playground - Write, automatically generate and run Rules and Flows online.
- codelingo.io/docs - Learn to write (and automatically generate!) Rules and compose Flows.
- github.com/codelingo/lingo - CLI client for Codelingo.
- github.com/codelingo/ideplugins - Run Flows directly in your IDE (Note: WIP).
We are a small VC backed development team from 🥝 New Zealand with a passion for the art of software development in itself!
Check out our team here: codelingo.io/about.