WIP: test stale repositories (#3210)
* fix typo in README.md fixes #3204 * #1446 implement test for stale repositories * fix #1446 * fixes #3211 added check if issue has not been previously opened * fixes #3211 add limit to number of issues created at a time * fixes #3211 reformat issue message * checks for dead links as well * fixes #3211 handle status code 302 and 301 * fixes #3211 handle status code 302 and 301 * fixes #3211 handle status code 302 and 301 * fixes #3211 test workflow * fixes #3211 test workflow * fixes #3211 test workflow again * fixes #3211 test workflow again * remove workflows and start over * re add workflow * apply review suggestions * add environment variable. modify workflow to run once a week * add check for archived repositories and reformat * reformat code to improve readability * reformat to improve readability * cause continue and not break if href not found * satisfy code climate requirements
This commit is contained in:
22
repo_test.go
22
repo_test.go
@@ -1,7 +1,6 @@
|
||||
package main
|
||||
|
||||
import (
|
||||
"bytes"
|
||||
"io/ioutil"
|
||||
"os"
|
||||
"regexp"
|
||||
@@ -11,7 +10,6 @@ import (
|
||||
"text/template"
|
||||
|
||||
"github.com/PuerkitoBio/goquery"
|
||||
"github.com/russross/blackfriday"
|
||||
gfm "github.com/shurcooL/github_flavored_markdown"
|
||||
)
|
||||
|
||||
@@ -97,26 +95,6 @@ func testList(t *testing.T, list *goquery.Selection) {
|
||||
})
|
||||
}
|
||||
|
||||
func readme() []byte {
|
||||
input, err := ioutil.ReadFile("./README.md")
|
||||
if err != nil {
|
||||
panic(err)
|
||||
}
|
||||
html := append([]byte("<body>"), blackfriday.MarkdownCommon(input)...)
|
||||
html = append(html, []byte("</body>")...)
|
||||
return html
|
||||
}
|
||||
|
||||
func startQuery() *goquery.Document {
|
||||
buf := bytes.NewBuffer(readme())
|
||||
query, err := goquery.NewDocumentFromReader(buf)
|
||||
if err != nil {
|
||||
panic(err)
|
||||
}
|
||||
|
||||
return query
|
||||
}
|
||||
|
||||
func checkAlphabeticOrder(t *testing.T, s *goquery.Selection) {
|
||||
items := s.Find("li > a:first-child").Map(func(_ int, li *goquery.Selection) string {
|
||||
return strings.ToLower(li.Text())
|
||||
|
Reference in New Issue
Block a user