Description
Problem:
We tend to have people posting often who don't know the three main ways to format code on slack. A bot to help them do this properly would save everyone some time and annoyance. Plus it should be fun to code.
This bot will activate when there is a post where a subset of the lines contains something that looks like code but is not formatted as such
So how to determine if something looks like code? Two possible approaches.
-
Heuristically. There are libraries out there that auto-detect language. Presumably some of the same processes can be used to detect whether something is code at all. Example of something that does this: highlight.js
-
ML. This is actually a pretty decent use case for something like a tensorflow classifier. And we could train it off of the actual operation code logs!