main.go 1.1 KB

12345678910111213141516171819202122232425262728293031323334353637
  1. package main
  2. import (
  3. "os"
  4. "regexp"
  5. )
  6. var (
  7. appRoot string
  8. regexes map[string]*regexp.Regexp
  9. assignRegex *regexp.Regexp
  10. report []ReportElem
  11. )
  12. func init() {
  13. appRoot, _ = os.Getwd()
  14. // TODO update regex to look for things like:
  15. // TODO ability to add/filter regex
  16. // client("AKAI32fJ334...",
  17. regexes = map[string]*regexp.Regexp{
  18. "github": regexp.MustCompile(`[g|G][i|I][t|T][h|H][u|U][b|B].*(=|:|:=|<-).*\w+.*`),
  19. "aws": regexp.MustCompile(`[a|A][w|W][s|S].*(=|:=|:|<-).*\w+.*`),
  20. "heroku": regexp.MustCompile(`[h|H][e|E][r|R][o|O][k|K][u|U].*(=|:=|:|<-).*\w+.*`),
  21. "facebook": regexp.MustCompile(`[f|F][a|A][c|C][e|E][b|B][o|O][o|O][k|K].*(=|:=|:|<-).*\w+.*`),
  22. "twitter": regexp.MustCompile(`[t|T][w|W][i|I][t|T][t|T][e|E][r|R].*(=|:=|:|<-).*\w+.*`),
  23. "reddit": regexp.MustCompile(`[r|R][e|E][d|D][d|D][i|I][t|T].*(=|:=|:|<-).*\w+.*`),
  24. "twilio": regexp.MustCompile(`[t|T][w|W][i|I][l|L][i|I][o|O].*(=|:=|:|<-).*\w+.*`),
  25. }
  26. assignRegex = regexp.MustCompile(`(=|:|:=|<-)`)
  27. }
  28. func main() {
  29. args := os.Args[2:]
  30. repoUrl := os.Args[1]
  31. opts := parseOptions(args, repoUrl)
  32. start(opts, repoUrl)
  33. }