From 9fb90c02f0e5ad6a300561958fa7097d8a0dce6b Mon Sep 17 00:00:00 2001 From: "dependabot-preview[bot]" <27856297+dependabot-preview[bot]@users.noreply.github.com> Date: Fri, 25 Sep 2020 06:49:46 -0700 Subject: [PATCH 01/42] Bump github.com/digitalocean/godo from 1.42.1 to 1.44.0 (#967) Bumps [github.com/digitalocean/godo](https://github.com/digitalocean/godo) from 1.42.1 to 1.44.0. - [Release notes](https://github.com/digitalocean/godo/releases) - [Changelog](https://github.com/digitalocean/godo/blob/main/CHANGELOG.md) - [Commits](https://github.com/digitalocean/godo/compare/v1.42.1...v1.44.0) Signed-off-by: dependabot-preview[bot] Co-authored-by: dependabot-preview[bot] <27856297+dependabot-preview[bot]@users.noreply.github.com> --- go.mod | 2 +- go.sum | 2 ++ 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/go.mod b/go.mod index 3b7706f8..fda99644 100644 --- a/go.mod +++ b/go.mod @@ -15,7 +15,7 @@ require ( github.com/briandowns/openweathermap v0.0.0-20180804155945-5f41b7c9d92d github.com/cenkalti/backoff v2.2.1+incompatible // indirect github.com/chzyer/readline v0.0.0-20180603132655-2972be24d48e - github.com/digitalocean/godo v1.42.1 + github.com/digitalocean/godo v1.44.0 github.com/docker/distribution v2.7.1+incompatible // indirect github.com/docker/docker v1.13.1 github.com/docker/docker-credential-helpers v0.6.3 diff --git a/go.sum b/go.sum index 855ec14d..b2ae82fc 100644 --- a/go.sum +++ b/go.sum @@ -179,6 +179,8 @@ github.com/dgrijalva/jwt-go v3.2.0+incompatible/go.mod h1:E3ru+11k8xSBh+hMPgOLZm github.com/dgryski/go-sip13 v0.0.0-20181026042036-e10d5fee7954/go.mod h1:vAd38F8PWV+bWy6jNmig1y/TA+kYO4g3RSRF0IAv0no= github.com/digitalocean/godo v1.42.1 h1:SJ/XMVsp5CZmyQal8gLlOl9jSl1i3FaN20LlgtK5ZMs= github.com/digitalocean/godo v1.42.1/go.mod h1:p7dOjjtSBqCTUksqtA5Fd3uaKs9kyTq2xcz76ulEJRU= +github.com/digitalocean/godo v1.44.0 h1:IMElzMUpO1dVR8qjSg53+5vDkOLzMbhJt4yTAq7NGCQ= +github.com/digitalocean/godo v1.44.0/go.mod h1:p7dOjjtSBqCTUksqtA5Fd3uaKs9kyTq2xcz76ulEJRU= github.com/dlclark/regexp2 v1.2.0 h1:8sAhBGEM0dRWogWqWyQeIJnxjWO6oIjl8FKqREDsGfk= github.com/dlclark/regexp2 v1.2.0/go.mod h1:2pZnwuY/m+8K6iRw6wQdMtk+rH5tNGR1i55kozfMjCc= github.com/dnaeon/go-vcr v0.0.0-20180920040454-5637cf3d8a31 h1:Dzuw9GtbmllUqEcoHfScT9YpKFUssSiZ5PgZkIGf/YQ= From 30b0d8a981383786ce784a6af00a792dbb2d7715 Mon Sep 17 00:00:00 2001 From: Chris Cummer Date: Fri, 25 Sep 2020 06:49:56 -0700 Subject: [PATCH 02/42] Update CHANGELOG.md --- CHANGELOG.md | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 3edc1028..eeeb8012 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,6 +2,15 @@ ## Unreleased +### 👍 Updated + +* Updated `github.com/gdamore/tcell` from 1.3.0 to 1.4.0 +* Updated `github.com/shirou/gopsutil` from 2.20.7+incompatible to 2.20.8+incompatible +* Updated `github.com/mmcdole/gofeed` from 1.0.0 to 1.1.0 +* Updated `github.com/digitalocean/godo` from 1.42.1 to 1.44.0 + +## v0.32.0 + ### ⚡️ Added * PagerDuty module now supports `showOncallEnd` setting, which determines whether or not to display the oncall rotation end date, by [@senorprogrammer](https://github.com/senorprogrammer) From 48dda57473d4532c34a5bc0b765c74f20fc91ae4 Mon Sep 17 00:00:00 2001 From: "dependabot-preview[bot]" <27856297+dependabot-preview[bot]@users.noreply.github.com> Date: Fri, 25 Sep 2020 06:50:29 -0700 Subject: [PATCH 03/42] Bump google.golang.org/api from 0.30.0 to 0.32.0 (#968) Bumps [google.golang.org/api](https://github.com/googleapis/google-api-go-client) from 0.30.0 to 0.32.0. - [Release notes](https://github.com/googleapis/google-api-go-client/releases) - [Changelog](https://github.com/googleapis/google-api-go-client/blob/master/CHANGES.md) - [Commits](https://github.com/googleapis/google-api-go-client/compare/v0.30.0...v0.32.0) Signed-off-by: dependabot-preview[bot] Co-authored-by: dependabot-preview[bot] <27856297+dependabot-preview[bot]@users.noreply.github.com> --- go.mod | 4 ++-- go.sum | 17 +++++++++++++++++ 2 files changed, 19 insertions(+), 2 deletions(-) diff --git a/go.mod b/go.mod index fda99644..6a4fc8c5 100644 --- a/go.mod +++ b/go.mod @@ -62,9 +62,9 @@ require ( github.com/xanzy/go-gitlab v0.33.0 github.com/zmb3/spotify v0.0.0-20191010212056-e12fb981aacb github.com/zorkian/go-datadog-api v2.29.0+incompatible - golang.org/x/oauth2 v0.0.0-20200107190931-bf48bf16ab8d + golang.org/x/oauth2 v0.0.0-20200902213428-5d25da1a8d43 golang.org/x/text v0.3.3 - google.golang.org/api v0.30.0 + google.golang.org/api v0.32.0 gopkg.in/check.v1 v1.0.0-20200227125254-8fa46927fb4f // indirect gopkg.in/jarcoal/httpmock.v1 v1.0.0-20181110093347-3be5f16b70eb // indirect gopkg.in/yaml.v2 v2.3.0 diff --git a/go.sum b/go.sum index b2ae82fc..f1dff525 100644 --- a/go.sum +++ b/go.sum @@ -15,6 +15,7 @@ cloud.google.com/go v0.56.0/go.mod h1:jr7tqZxxKOVYizybht9+26Z/gUq7tiRzu+ACVAMbKV cloud.google.com/go v0.57.0/go.mod h1:oXiQ6Rzq3RAkkY7N6t3TcE6jE+CIBBbA36lwQ1JyzZs= cloud.google.com/go v0.62.0 h1:RmDygqvj27Zf3fCQjQRtLyC7KwFcHkeJitcO0OoGOcA= cloud.google.com/go v0.62.0/go.mod h1:jmCYTdRCQuc1PHIIJ/maLInMho30T/Y0M4hTdTShOYc= +cloud.google.com/go v0.65.0/go.mod h1:O5N8zS7uWy9vkA9vayVHs65eM1ubvY4h553ofrNHObY= cloud.google.com/go/bigquery v1.0.1/go.mod h1:i/xbL2UlR5RvWAURpBYZTtm/cXjCha9lbfbpx4poX+o= cloud.google.com/go/bigquery v1.3.0/go.mod h1:PjpwJnslEMmckchkHFfq+HTD2DmtT67aNFKH1/VBDHE= cloud.google.com/go/bigquery v1.4.0 h1:xE3CPsOgttP4ACBePh79zTKALtXwn/Edhcr16R5hMWU= @@ -291,6 +292,7 @@ github.com/golang/mock v1.3.1/go.mod h1:sBzyDLLjw3U8JLTeZvSv8jJB+tU5PVekmnlKIyFU github.com/golang/mock v1.4.0/go.mod h1:UOMv5ysSaYNkG+OFQykRIcU/QvvxJf3p21QfJ2Bt3cw= github.com/golang/mock v1.4.1/go.mod h1:UOMv5ysSaYNkG+OFQykRIcU/QvvxJf3p21QfJ2Bt3cw= github.com/golang/mock v1.4.3/go.mod h1:UOMv5ysSaYNkG+OFQykRIcU/QvvxJf3p21QfJ2Bt3cw= +github.com/golang/mock v1.4.4/go.mod h1:l3mdAwkq5BuhzHwde/uurv3sEJeZMXNpwsxVWU71h+4= github.com/golang/protobuf v1.2.0/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U= github.com/golang/protobuf v1.3.1/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U= github.com/golang/protobuf v1.3.2/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U= @@ -321,6 +323,7 @@ github.com/google/go-cmp v0.4.1/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/ github.com/google/go-cmp v0.5.0/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= github.com/google/go-cmp v0.5.1 h1:JFrFEBb2xKufg6XkJsJr+WbKb4FQlURi5RUcBveYu9k= github.com/google/go-cmp v0.5.1/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= +github.com/google/go-cmp v0.5.2/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= github.com/google/go-github/v26 v26.1.3 h1:n03e8IGgLdD78L+ETWxvqpBIBWEZLlTBCQVU2yImw1o= github.com/google/go-github/v26 v26.1.3/go.mod h1:v6/FmX9au22j4CtYxnMhJJkP+JfOQDXALk7hI+MPDNM= github.com/google/go-querystring v1.0.0 h1:Xkwi/a1rcvNg1PPYe5vI8GbeBY/jrVuDX5ASuANWTrk= @@ -765,6 +768,7 @@ github.com/yuin/gluare v0.0.0-20170607022532-d7c94f1a80ed/go.mod h1:9w6KSdZh23UW github.com/yuin/goldmark v1.1.25/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74= github.com/yuin/goldmark v1.1.27/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74= github.com/yuin/goldmark v1.1.32/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74= +github.com/yuin/goldmark v1.2.1/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74= github.com/yuin/gopher-lua v0.0.0-20170901023928-8c2befcd3908 h1:D1Gc3nOtLEadaHIZD98eX2ABnEi0OW7UZGogFWERsFI= github.com/yuin/gopher-lua v0.0.0-20170901023928-8c2befcd3908/go.mod h1:aEV29XrmTYFr3CiRxZeGHpkvbwq+prZduBqMaascyCU= github.com/ziutek/mymysql v1.5.4 h1:GB0qdRGsTwQSBVYuVShFBKaXSnSnYYC2d9knnE1LHFs= @@ -871,6 +875,7 @@ golang.org/x/net v0.0.0-20200520182314-0ba52f642ac2/go.mod h1:qpuaurCH72eLCgpAm/ golang.org/x/net v0.0.0-20200625001655-4c5254603344/go.mod h1:/O7V0waA8r7cgGh81Ro3o1hOxt32SMVPicZroKQ2sZA= golang.org/x/net v0.0.0-20200707034311-ab3426394381 h1:VXak5I6aEWmAXeQjA+QSZzlgNrpq9mjcfDemuexIKsU= golang.org/x/net v0.0.0-20200707034311-ab3426394381/go.mod h1:/O7V0waA8r7cgGh81Ro3o1hOxt32SMVPicZroKQ2sZA= +golang.org/x/net v0.0.0-20200822124328-c89045814202/go.mod h1:/O7V0waA8r7cgGh81Ro3o1hOxt32SMVPicZroKQ2sZA= golang.org/x/oauth2 v0.0.0-20180821212333-d2e6202438be/go.mod h1:N/0e6XlmueqKjAGxoOufVs8QHGRruUQn6yWY3a++T0U= golang.org/x/oauth2 v0.0.0-20181106182150-f42d05182288/go.mod h1:N/0e6XlmueqKjAGxoOufVs8QHGRruUQn6yWY3a++T0U= golang.org/x/oauth2 v0.0.0-20190226205417-e64efc72b421/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw= @@ -878,6 +883,7 @@ golang.org/x/oauth2 v0.0.0-20190604053449-0f29369cfe45/go.mod h1:gOpvHmFTYa4Iltr golang.org/x/oauth2 v0.0.0-20191202225959-858c2ad4c8b6/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw= golang.org/x/oauth2 v0.0.0-20200107190931-bf48bf16ab8d h1:TzXSXBo42m9gQenoE3b9BGiEpg5IG2JkU5FkPIawgtw= golang.org/x/oauth2 v0.0.0-20200107190931-bf48bf16ab8d/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw= +golang.org/x/oauth2 v0.0.0-20200902213428-5d25da1a8d43/go.mod h1:KelEdhl1UZF7XfJ4dDtk6s++YSgaE7mD/BuKKDLBl4A= golang.org/x/sync v0.0.0-20180314180146-1d60e4601c6f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20181108010431-42b317875d0f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20181221193216-37e7f081c4d4/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= @@ -932,6 +938,7 @@ golang.org/x/sys v0.0.0-20200515095857-1151b9dac4a9/go.mod h1:h1NjWce9XRLGQEsW7w golang.org/x/sys v0.0.0-20200523222454-059865788121/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20200803210538-64077c9b5642 h1:B6caxRw+hozq68X2MY7jEpZh/cr4/aHLv9xU8Kkadrw= golang.org/x/sys v0.0.0-20200803210538-64077c9b5642/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20200905004654-be1d3432aa8f/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/text v0.0.0-20170915032832-14c0d48ead0c/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= golang.org/x/text v0.3.1-0.20180807135948-17ff2d5776d2/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= @@ -986,10 +993,15 @@ golang.org/x/tools v0.0.0-20200618134242-20370b0cb4b2/go.mod h1:EkVYQZoAsY45+roY golang.org/x/tools v0.0.0-20200729194436-6467de6f59a7/go.mod h1:njjCfa9FT2d7l9Bc6FUM5FLjQPp3cFF28FI3qnDFljA= golang.org/x/tools v0.0.0-20200804011535-6c149bb5ef0d h1:szSOL78iTCl0LF1AMjhSWJj8tIM0KixlUUnBtYXsmd8= golang.org/x/tools v0.0.0-20200804011535-6c149bb5ef0d/go.mod h1:njjCfa9FT2d7l9Bc6FUM5FLjQPp3cFF28FI3qnDFljA= +golang.org/x/tools v0.0.0-20200825202427-b303f430e36d/go.mod h1:njjCfa9FT2d7l9Bc6FUM5FLjQPp3cFF28FI3qnDFljA= +golang.org/x/tools v0.0.0-20200904185747-39188db58858 h1:xLt+iB5ksWcZVxqc+g9K41ZHy+6MKWfXCDsjSThnsPA= +golang.org/x/tools v0.0.0-20200904185747-39188db58858/go.mod h1:Cj7w3i3Rnn0Xh82ur9kSqwfTHTeVxaDqrfMjpcNT6bE= golang.org/x/xerrors v0.0.0-20190717185122-a985d3407aa7/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= golang.org/x/xerrors v0.0.0-20191011141410-1b5146add898/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543 h1:E7g+9GITq07hpfrRu66IVDexMakfv52eLZ2CXBWiKr4= golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= +golang.org/x/xerrors v0.0.0-20200804184101-5ec99f83aff1 h1:go1bK/D/BFZV2I8cIQd1NKEZ+0owSTG1fDTci4IqFcE= +golang.org/x/xerrors v0.0.0-20200804184101-5ec99f83aff1/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= google.golang.org/api v0.3.1/go.mod h1:6wY9I6uQWHQ8EM57III9mq/AjF+i8G65rmVagqKMtkk= google.golang.org/api v0.3.2/go.mod h1:6wY9I6uQWHQ8EM57III9mq/AjF+i8G65rmVagqKMtkk= google.golang.org/api v0.4.0/go.mod h1:8k5glujaEP+g9n7WNsDg8QP6cUVNI86fCNMcbazEtwE= @@ -1010,6 +1022,8 @@ google.golang.org/api v0.29.0 h1:BaiDisFir8O4IJxvAabCGGkQ6yCJegNQqSVoYUNAnbk= google.golang.org/api v0.29.0/go.mod h1:Lcubydp8VUV7KeIHD9z2Bys/sm/vGKnG1UHuDBSrHWM= google.golang.org/api v0.30.0 h1:yfrXXP61wVuLb0vBcG6qaOoIoqYEzOQS8jum51jkv2w= google.golang.org/api v0.30.0/go.mod h1:QGmEvQ87FHZNiUVJkT14jQNYJ4ZJjdRF23ZXz5138Fc= +google.golang.org/api v0.32.0 h1:Le77IccnTqEa8ryp9wIpX5W3zYm7Gf9LhOp9PHcwFts= +google.golang.org/api v0.32.0/go.mod h1:/XrVsuzM0rZmrsbjJutiuftIzeuTQcEeaYcSk/mQ1dg= google.golang.org/appengine v1.1.0/go.mod h1:EbEs0AVv82hx2wNQdGPgUI5lhzA/G0D9YwlJXL52JkM= google.golang.org/appengine v1.3.0/go.mod h1:xpcJRLb0r/rnEns0DIKYYv+WjYCduHsrkT7/EB5XEv4= google.golang.org/appengine v1.4.0/go.mod h1:xpcJRLb0r/rnEns0DIKYYv+WjYCduHsrkT7/EB5XEv4= @@ -1050,6 +1064,8 @@ google.golang.org/genproto v0.0.0-20200618031413-b414f8b61790/go.mod h1:jDfRM7Fc google.golang.org/genproto v0.0.0-20200729003335-053ba62fc06f/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= google.golang.org/genproto v0.0.0-20200804131852-c06518451d9c h1:Lq4llNryJoaVFRmvrIwC/ZHH7tNt4tUYIu8+se2aayY= google.golang.org/genproto v0.0.0-20200804131852-c06518451d9c/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= +google.golang.org/genproto v0.0.0-20200825200019-8632dd797987/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= +google.golang.org/genproto v0.0.0-20200904004341-0bd0a958aa1d/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= google.golang.org/grpc v1.17.0/go.mod h1:6QZJwpn2B+Zp71q/5VxRsJ6NXXVCE5NRUHRo+f3cWCs= google.golang.org/grpc v1.19.0/go.mod h1:mqu4LbDTu4XGKhr4mRzUsmM4RtVoemTSY81AxZiDr8c= google.golang.org/grpc v1.20.1/go.mod h1:10oTOabMzJvdu6/UiuZezV6QK5dSlG84ov/aaiqXj38= @@ -1064,6 +1080,7 @@ google.golang.org/grpc v1.28.0 h1:bO/TA4OxCOummhSf10siHuG7vJOiwh7SpRpFZDkOgl4= google.golang.org/grpc v1.28.0/go.mod h1:rpkK4SK4GF4Ach/+MFLZUBavHOvF2JJB5uozKKal+60= google.golang.org/grpc v1.29.1 h1:EC2SB8S04d2r73uptxphDSUG+kTKVgjRPF+N3xpxRB4= google.golang.org/grpc v1.29.1/go.mod h1:itym6AZVZYACWQqET3MqgPpjcuV5QH3BxFS3IjizoKk= +google.golang.org/grpc v1.31.1/go.mod h1:N36X2cJ7JwdamYAgDz+s+rVMFjt3numwzf/HckM8pak= google.golang.org/protobuf v0.0.0-20200109180630-ec00e32a8dfd/go.mod h1:DFci5gLYBciE7Vtevhsrf46CRTquxDuWsQurQQe4oz8= google.golang.org/protobuf v0.0.0-20200221191635-4d8936d0db64/go.mod h1:kwYJMbMJ01Woi6D6+Kah6886xMZcty6N08ah7+eCXa0= google.golang.org/protobuf v0.0.0-20200228230310-ab0ca4ff8a60/go.mod h1:cfTl7dwQJ+fmap5saPgwCLgHXTUD7jkjRqWcaiX5VyM= From caa721d6e12eec8b43335a97789b2328783a01d9 Mon Sep 17 00:00:00 2001 From: "dependabot-preview[bot]" <27856297+dependabot-preview[bot]@users.noreply.github.com> Date: Fri, 25 Sep 2020 06:51:44 -0700 Subject: [PATCH 04/42] Bump github.com/xanzy/go-gitlab from 0.33.0 to 0.38.1 (#969) Bumps [github.com/xanzy/go-gitlab](https://github.com/xanzy/go-gitlab) from 0.33.0 to 0.38.1. - [Release notes](https://github.com/xanzy/go-gitlab/releases) - [Changelog](https://github.com/xanzy/go-gitlab/blob/master/CHANGELOG.md) - [Commits](https://github.com/xanzy/go-gitlab/compare/v0.33.0...v0.38.1) Signed-off-by: dependabot-preview[bot] Co-authored-by: dependabot-preview[bot] <27856297+dependabot-preview[bot]@users.noreply.github.com> --- go.mod | 2 +- go.sum | 2 ++ 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/go.mod b/go.mod index 6a4fc8c5..688470df 100644 --- a/go.mod +++ b/go.mod @@ -59,7 +59,7 @@ require ( github.com/stretchr/testify v1.6.1 github.com/wtfutil/spotigopher v0.0.0-20191127141047-7d8168fe103a github.com/wtfutil/todoist v0.0.2-0.20191216004217-0ec29ceda61a - github.com/xanzy/go-gitlab v0.33.0 + github.com/xanzy/go-gitlab v0.38.1 github.com/zmb3/spotify v0.0.0-20191010212056-e12fb981aacb github.com/zorkian/go-datadog-api v2.29.0+incompatible golang.org/x/oauth2 v0.0.0-20200902213428-5d25da1a8d43 diff --git a/go.sum b/go.sum index f1dff525..580aadfd 100644 --- a/go.sum +++ b/go.sum @@ -758,6 +758,8 @@ github.com/wtfutil/todoist v0.0.2-0.20191216004217-0ec29ceda61a/go.mod h1:YuuGLJ github.com/xanzy/go-gitlab v0.15.0/go.mod h1:8zdQa/ri1dfn8eS3Ir1SyfvOKlw7WBJ8DVThkpGiXrs= github.com/xanzy/go-gitlab v0.33.0 h1:MUJZknbLhVXSFzBA5eqGGhQ2yHSu8tPbGBPeB3sN4B0= github.com/xanzy/go-gitlab v0.33.0/go.mod h1:sPLojNBn68fMUWSxIJtdVVIP8uSBYqesTfDUseX11Ug= +github.com/xanzy/go-gitlab v0.38.1 h1:st5/Ag4h8CqVfp3LpOWW0Jd4jYHTGETwu0KksYDPnYE= +github.com/xanzy/go-gitlab v0.38.1/go.mod h1:sPLojNBn68fMUWSxIJtdVVIP8uSBYqesTfDUseX11Ug= github.com/xi2/xz v0.0.0-20171230120015-48954b6210f8/go.mod h1:HUYIGzjTL3rfEspMxjDjgmT5uz5wzYJKVo23qUhYTos= github.com/xiang90/probing v0.0.0-20190116061207-43a291ad63a2 h1:eY9dn8+vbi4tKz5Qo6v2eYzo7kUS51QINcR5jNpbZS8= github.com/xiang90/probing v0.0.0-20190116061207-43a291ad63a2/go.mod h1:UETIi67q53MR2AWcXfiuqkDkRtnGDLqkBTpCHuJHxtU= From dae9135e1d62a78e713201be5d6db0df256dde5b Mon Sep 17 00:00:00 2001 From: Chris Cummer Date: Fri, 25 Sep 2020 06:53:21 -0700 Subject: [PATCH 05/42] Revert "Bump google.golang.org/api from 0.30.0 to 0.32.0 (#968)" (#972) This reverts commit 48dda57473d4532c34a5bc0b765c74f20fc91ae4. --- go.mod | 4 ++-- go.sum | 17 ----------------- 2 files changed, 2 insertions(+), 19 deletions(-) diff --git a/go.mod b/go.mod index 688470df..e4c8df0b 100644 --- a/go.mod +++ b/go.mod @@ -62,9 +62,9 @@ require ( github.com/xanzy/go-gitlab v0.38.1 github.com/zmb3/spotify v0.0.0-20191010212056-e12fb981aacb github.com/zorkian/go-datadog-api v2.29.0+incompatible - golang.org/x/oauth2 v0.0.0-20200902213428-5d25da1a8d43 + golang.org/x/oauth2 v0.0.0-20200107190931-bf48bf16ab8d golang.org/x/text v0.3.3 - google.golang.org/api v0.32.0 + google.golang.org/api v0.30.0 gopkg.in/check.v1 v1.0.0-20200227125254-8fa46927fb4f // indirect gopkg.in/jarcoal/httpmock.v1 v1.0.0-20181110093347-3be5f16b70eb // indirect gopkg.in/yaml.v2 v2.3.0 diff --git a/go.sum b/go.sum index 580aadfd..fcbc1bf5 100644 --- a/go.sum +++ b/go.sum @@ -15,7 +15,6 @@ cloud.google.com/go v0.56.0/go.mod h1:jr7tqZxxKOVYizybht9+26Z/gUq7tiRzu+ACVAMbKV cloud.google.com/go v0.57.0/go.mod h1:oXiQ6Rzq3RAkkY7N6t3TcE6jE+CIBBbA36lwQ1JyzZs= cloud.google.com/go v0.62.0 h1:RmDygqvj27Zf3fCQjQRtLyC7KwFcHkeJitcO0OoGOcA= cloud.google.com/go v0.62.0/go.mod h1:jmCYTdRCQuc1PHIIJ/maLInMho30T/Y0M4hTdTShOYc= -cloud.google.com/go v0.65.0/go.mod h1:O5N8zS7uWy9vkA9vayVHs65eM1ubvY4h553ofrNHObY= cloud.google.com/go/bigquery v1.0.1/go.mod h1:i/xbL2UlR5RvWAURpBYZTtm/cXjCha9lbfbpx4poX+o= cloud.google.com/go/bigquery v1.3.0/go.mod h1:PjpwJnslEMmckchkHFfq+HTD2DmtT67aNFKH1/VBDHE= cloud.google.com/go/bigquery v1.4.0 h1:xE3CPsOgttP4ACBePh79zTKALtXwn/Edhcr16R5hMWU= @@ -292,7 +291,6 @@ github.com/golang/mock v1.3.1/go.mod h1:sBzyDLLjw3U8JLTeZvSv8jJB+tU5PVekmnlKIyFU github.com/golang/mock v1.4.0/go.mod h1:UOMv5ysSaYNkG+OFQykRIcU/QvvxJf3p21QfJ2Bt3cw= github.com/golang/mock v1.4.1/go.mod h1:UOMv5ysSaYNkG+OFQykRIcU/QvvxJf3p21QfJ2Bt3cw= github.com/golang/mock v1.4.3/go.mod h1:UOMv5ysSaYNkG+OFQykRIcU/QvvxJf3p21QfJ2Bt3cw= -github.com/golang/mock v1.4.4/go.mod h1:l3mdAwkq5BuhzHwde/uurv3sEJeZMXNpwsxVWU71h+4= github.com/golang/protobuf v1.2.0/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U= github.com/golang/protobuf v1.3.1/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U= github.com/golang/protobuf v1.3.2/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U= @@ -323,7 +321,6 @@ github.com/google/go-cmp v0.4.1/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/ github.com/google/go-cmp v0.5.0/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= github.com/google/go-cmp v0.5.1 h1:JFrFEBb2xKufg6XkJsJr+WbKb4FQlURi5RUcBveYu9k= github.com/google/go-cmp v0.5.1/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= -github.com/google/go-cmp v0.5.2/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= github.com/google/go-github/v26 v26.1.3 h1:n03e8IGgLdD78L+ETWxvqpBIBWEZLlTBCQVU2yImw1o= github.com/google/go-github/v26 v26.1.3/go.mod h1:v6/FmX9au22j4CtYxnMhJJkP+JfOQDXALk7hI+MPDNM= github.com/google/go-querystring v1.0.0 h1:Xkwi/a1rcvNg1PPYe5vI8GbeBY/jrVuDX5ASuANWTrk= @@ -770,7 +767,6 @@ github.com/yuin/gluare v0.0.0-20170607022532-d7c94f1a80ed/go.mod h1:9w6KSdZh23UW github.com/yuin/goldmark v1.1.25/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74= github.com/yuin/goldmark v1.1.27/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74= github.com/yuin/goldmark v1.1.32/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74= -github.com/yuin/goldmark v1.2.1/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74= github.com/yuin/gopher-lua v0.0.0-20170901023928-8c2befcd3908 h1:D1Gc3nOtLEadaHIZD98eX2ABnEi0OW7UZGogFWERsFI= github.com/yuin/gopher-lua v0.0.0-20170901023928-8c2befcd3908/go.mod h1:aEV29XrmTYFr3CiRxZeGHpkvbwq+prZduBqMaascyCU= github.com/ziutek/mymysql v1.5.4 h1:GB0qdRGsTwQSBVYuVShFBKaXSnSnYYC2d9knnE1LHFs= @@ -877,7 +873,6 @@ golang.org/x/net v0.0.0-20200520182314-0ba52f642ac2/go.mod h1:qpuaurCH72eLCgpAm/ golang.org/x/net v0.0.0-20200625001655-4c5254603344/go.mod h1:/O7V0waA8r7cgGh81Ro3o1hOxt32SMVPicZroKQ2sZA= golang.org/x/net v0.0.0-20200707034311-ab3426394381 h1:VXak5I6aEWmAXeQjA+QSZzlgNrpq9mjcfDemuexIKsU= golang.org/x/net v0.0.0-20200707034311-ab3426394381/go.mod h1:/O7V0waA8r7cgGh81Ro3o1hOxt32SMVPicZroKQ2sZA= -golang.org/x/net v0.0.0-20200822124328-c89045814202/go.mod h1:/O7V0waA8r7cgGh81Ro3o1hOxt32SMVPicZroKQ2sZA= golang.org/x/oauth2 v0.0.0-20180821212333-d2e6202438be/go.mod h1:N/0e6XlmueqKjAGxoOufVs8QHGRruUQn6yWY3a++T0U= golang.org/x/oauth2 v0.0.0-20181106182150-f42d05182288/go.mod h1:N/0e6XlmueqKjAGxoOufVs8QHGRruUQn6yWY3a++T0U= golang.org/x/oauth2 v0.0.0-20190226205417-e64efc72b421/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw= @@ -885,7 +880,6 @@ golang.org/x/oauth2 v0.0.0-20190604053449-0f29369cfe45/go.mod h1:gOpvHmFTYa4Iltr golang.org/x/oauth2 v0.0.0-20191202225959-858c2ad4c8b6/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw= golang.org/x/oauth2 v0.0.0-20200107190931-bf48bf16ab8d h1:TzXSXBo42m9gQenoE3b9BGiEpg5IG2JkU5FkPIawgtw= golang.org/x/oauth2 v0.0.0-20200107190931-bf48bf16ab8d/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw= -golang.org/x/oauth2 v0.0.0-20200902213428-5d25da1a8d43/go.mod h1:KelEdhl1UZF7XfJ4dDtk6s++YSgaE7mD/BuKKDLBl4A= golang.org/x/sync v0.0.0-20180314180146-1d60e4601c6f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20181108010431-42b317875d0f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20181221193216-37e7f081c4d4/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= @@ -940,7 +934,6 @@ golang.org/x/sys v0.0.0-20200515095857-1151b9dac4a9/go.mod h1:h1NjWce9XRLGQEsW7w golang.org/x/sys v0.0.0-20200523222454-059865788121/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20200803210538-64077c9b5642 h1:B6caxRw+hozq68X2MY7jEpZh/cr4/aHLv9xU8Kkadrw= golang.org/x/sys v0.0.0-20200803210538-64077c9b5642/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20200905004654-be1d3432aa8f/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/text v0.0.0-20170915032832-14c0d48ead0c/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= golang.org/x/text v0.3.1-0.20180807135948-17ff2d5776d2/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= @@ -995,15 +988,10 @@ golang.org/x/tools v0.0.0-20200618134242-20370b0cb4b2/go.mod h1:EkVYQZoAsY45+roY golang.org/x/tools v0.0.0-20200729194436-6467de6f59a7/go.mod h1:njjCfa9FT2d7l9Bc6FUM5FLjQPp3cFF28FI3qnDFljA= golang.org/x/tools v0.0.0-20200804011535-6c149bb5ef0d h1:szSOL78iTCl0LF1AMjhSWJj8tIM0KixlUUnBtYXsmd8= golang.org/x/tools v0.0.0-20200804011535-6c149bb5ef0d/go.mod h1:njjCfa9FT2d7l9Bc6FUM5FLjQPp3cFF28FI3qnDFljA= -golang.org/x/tools v0.0.0-20200825202427-b303f430e36d/go.mod h1:njjCfa9FT2d7l9Bc6FUM5FLjQPp3cFF28FI3qnDFljA= -golang.org/x/tools v0.0.0-20200904185747-39188db58858 h1:xLt+iB5ksWcZVxqc+g9K41ZHy+6MKWfXCDsjSThnsPA= -golang.org/x/tools v0.0.0-20200904185747-39188db58858/go.mod h1:Cj7w3i3Rnn0Xh82ur9kSqwfTHTeVxaDqrfMjpcNT6bE= golang.org/x/xerrors v0.0.0-20190717185122-a985d3407aa7/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= golang.org/x/xerrors v0.0.0-20191011141410-1b5146add898/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543 h1:E7g+9GITq07hpfrRu66IVDexMakfv52eLZ2CXBWiKr4= golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= -golang.org/x/xerrors v0.0.0-20200804184101-5ec99f83aff1 h1:go1bK/D/BFZV2I8cIQd1NKEZ+0owSTG1fDTci4IqFcE= -golang.org/x/xerrors v0.0.0-20200804184101-5ec99f83aff1/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= google.golang.org/api v0.3.1/go.mod h1:6wY9I6uQWHQ8EM57III9mq/AjF+i8G65rmVagqKMtkk= google.golang.org/api v0.3.2/go.mod h1:6wY9I6uQWHQ8EM57III9mq/AjF+i8G65rmVagqKMtkk= google.golang.org/api v0.4.0/go.mod h1:8k5glujaEP+g9n7WNsDg8QP6cUVNI86fCNMcbazEtwE= @@ -1024,8 +1012,6 @@ google.golang.org/api v0.29.0 h1:BaiDisFir8O4IJxvAabCGGkQ6yCJegNQqSVoYUNAnbk= google.golang.org/api v0.29.0/go.mod h1:Lcubydp8VUV7KeIHD9z2Bys/sm/vGKnG1UHuDBSrHWM= google.golang.org/api v0.30.0 h1:yfrXXP61wVuLb0vBcG6qaOoIoqYEzOQS8jum51jkv2w= google.golang.org/api v0.30.0/go.mod h1:QGmEvQ87FHZNiUVJkT14jQNYJ4ZJjdRF23ZXz5138Fc= -google.golang.org/api v0.32.0 h1:Le77IccnTqEa8ryp9wIpX5W3zYm7Gf9LhOp9PHcwFts= -google.golang.org/api v0.32.0/go.mod h1:/XrVsuzM0rZmrsbjJutiuftIzeuTQcEeaYcSk/mQ1dg= google.golang.org/appengine v1.1.0/go.mod h1:EbEs0AVv82hx2wNQdGPgUI5lhzA/G0D9YwlJXL52JkM= google.golang.org/appengine v1.3.0/go.mod h1:xpcJRLb0r/rnEns0DIKYYv+WjYCduHsrkT7/EB5XEv4= google.golang.org/appengine v1.4.0/go.mod h1:xpcJRLb0r/rnEns0DIKYYv+WjYCduHsrkT7/EB5XEv4= @@ -1066,8 +1052,6 @@ google.golang.org/genproto v0.0.0-20200618031413-b414f8b61790/go.mod h1:jDfRM7Fc google.golang.org/genproto v0.0.0-20200729003335-053ba62fc06f/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= google.golang.org/genproto v0.0.0-20200804131852-c06518451d9c h1:Lq4llNryJoaVFRmvrIwC/ZHH7tNt4tUYIu8+se2aayY= google.golang.org/genproto v0.0.0-20200804131852-c06518451d9c/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= -google.golang.org/genproto v0.0.0-20200825200019-8632dd797987/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= -google.golang.org/genproto v0.0.0-20200904004341-0bd0a958aa1d/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= google.golang.org/grpc v1.17.0/go.mod h1:6QZJwpn2B+Zp71q/5VxRsJ6NXXVCE5NRUHRo+f3cWCs= google.golang.org/grpc v1.19.0/go.mod h1:mqu4LbDTu4XGKhr4mRzUsmM4RtVoemTSY81AxZiDr8c= google.golang.org/grpc v1.20.1/go.mod h1:10oTOabMzJvdu6/UiuZezV6QK5dSlG84ov/aaiqXj38= @@ -1082,7 +1066,6 @@ google.golang.org/grpc v1.28.0 h1:bO/TA4OxCOummhSf10siHuG7vJOiwh7SpRpFZDkOgl4= google.golang.org/grpc v1.28.0/go.mod h1:rpkK4SK4GF4Ach/+MFLZUBavHOvF2JJB5uozKKal+60= google.golang.org/grpc v1.29.1 h1:EC2SB8S04d2r73uptxphDSUG+kTKVgjRPF+N3xpxRB4= google.golang.org/grpc v1.29.1/go.mod h1:itym6AZVZYACWQqET3MqgPpjcuV5QH3BxFS3IjizoKk= -google.golang.org/grpc v1.31.1/go.mod h1:N36X2cJ7JwdamYAgDz+s+rVMFjt3numwzf/HckM8pak= google.golang.org/protobuf v0.0.0-20200109180630-ec00e32a8dfd/go.mod h1:DFci5gLYBciE7Vtevhsrf46CRTquxDuWsQurQQe4oz8= google.golang.org/protobuf v0.0.0-20200221191635-4d8936d0db64/go.mod h1:kwYJMbMJ01Woi6D6+Kah6886xMZcty6N08ah7+eCXa0= google.golang.org/protobuf v0.0.0-20200228230310-ab0ca4ff8a60/go.mod h1:cfTl7dwQJ+fmap5saPgwCLgHXTUD7jkjRqWcaiX5VyM= From 6a5f4ba54deb9be7e9dbffe1581f71473d50b192 Mon Sep 17 00:00:00 2001 From: "dependabot-preview[bot]" <27856297+dependabot-preview[bot]@users.noreply.github.com> Date: Fri, 25 Sep 2020 06:54:18 -0700 Subject: [PATCH 06/42] Bump github.com/adlio/trello from 1.7.0 to 1.8.0 (#970) Bumps [github.com/adlio/trello](https://github.com/adlio/trello) from 1.7.0 to 1.8.0. - [Release notes](https://github.com/adlio/trello/releases) - [Commits](https://github.com/adlio/trello/compare/v1.7.0...v1.8.0) Signed-off-by: dependabot-preview[bot] Co-authored-by: dependabot-preview[bot] <27856297+dependabot-preview[bot]@users.noreply.github.com> --- go.mod | 2 +- go.sum | 2 ++ 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/go.mod b/go.mod index e4c8df0b..94446e69 100644 --- a/go.mod +++ b/go.mod @@ -9,7 +9,7 @@ require ( github.com/PagerDuty/go-pagerduty v0.0.0-20191002190746-f60f4fc45222 github.com/StackExchange/wmi v0.0.0-20190523213315-cbe66965904d // indirect github.com/VictorAvelar/devto-api-go v1.0.0 - github.com/adlio/trello v1.7.0 + github.com/adlio/trello v1.8.0 github.com/alecthomas/chroma v0.8.0 github.com/andygrunwald/go-gerrit v0.0.0-20190825170856-5959a9bf9ff8 github.com/briandowns/openweathermap v0.0.0-20180804155945-5f41b7c9d92d diff --git a/go.sum b/go.sum index fcbc1bf5..46478914 100644 --- a/go.sum +++ b/go.sum @@ -86,6 +86,8 @@ github.com/VictorAvelar/devto-api-go v1.0.0 h1:oXmzye3xYvlgBX18vX4+v6LVbjoihgIok github.com/VictorAvelar/devto-api-go v1.0.0/go.mod h1:gX13cqzMdpo49qP8VtBR2uCnzW7d76LFrAVSX2eLifY= github.com/adlio/trello v1.7.0 h1:syLRJ27wCM8URf7zOBWGr981cG+dpmLSyMqjEoQc+4g= github.com/adlio/trello v1.7.0/go.mod h1:l2068AhUuUuQ9Vsb95ECMueHThYyAj4e85lWPmr2/LE= +github.com/adlio/trello v1.8.0 h1:VU/1zwzuRzATsFC8WiK4f8R0HHQPWpf2H658KEchsmA= +github.com/adlio/trello v1.8.0/go.mod h1:l2068AhUuUuQ9Vsb95ECMueHThYyAj4e85lWPmr2/LE= github.com/alecthomas/assert v0.0.0-20170929043011-405dbfeb8e38 h1:smF2tmSOzy2Mm+0dGI2AIUHY+w0BUc+4tn40djz7+6U= github.com/alecthomas/assert v0.0.0-20170929043011-405dbfeb8e38/go.mod h1:r7bzyVFMNntcxPZXK3/+KdruV1H5KSlyVY0gc+NgInI= github.com/alecthomas/chroma v0.8.0 h1:HS+HE97sgcqjQGu5uVr8jIE55Mmh5UeQ7kckAhHg2pY= From 904df45548ac930487b9ab8f0c256d1184533748 Mon Sep 17 00:00:00 2001 From: Chris Cummer Date: Fri, 25 Sep 2020 06:54:53 -0700 Subject: [PATCH 07/42] go mod tidy Signed-off-by: Chris Cummer --- go.sum | 13 ------------- 1 file changed, 13 deletions(-) diff --git a/go.sum b/go.sum index fcbc1bf5..0b275690 100644 --- a/go.sum +++ b/go.sum @@ -68,8 +68,6 @@ github.com/Nvveen/Gotty v0.0.0-20120604004816-cd527374f1e5/go.mod h1:lmUJ/7eu/Q8 github.com/OneOfOne/xxhash v1.2.2/go.mod h1:HSdplMjZKSmBqAxg5vPj2TmRDmfkzw+cTzAElWljhcU= github.com/PagerDuty/go-pagerduty v0.0.0-20191002190746-f60f4fc45222 h1:QBpFoUrMKvjkZCKiLXylgPPK/cZcp8lviB0AzlABlFA= github.com/PagerDuty/go-pagerduty v0.0.0-20191002190746-f60f4fc45222/go.mod h1:6hH58nzwYc9mw+TPyM1anW0ivbI0ti4lYc+ZBaKmWts= -github.com/PuerkitoBio/goquery v1.5.0 h1:uGvmFXOA73IKluu/F84Xd1tt/z07GYm8X49XKHP7EJk= -github.com/PuerkitoBio/goquery v1.5.0/go.mod h1:qD2PgZ9lccMbQlc7eEOjaeRlFQON7xY8kdmcsrnKqMg= github.com/PuerkitoBio/goquery v1.5.1 h1:PSPBGne8NIUWw+/7vFBV+kG2J/5MOjbzc7154OaKCSE= github.com/PuerkitoBio/goquery v1.5.1/go.mod h1:GsLWisAFVj4WgDibEWF4pvYnkVQBpKBKeU+7zCJoLcc= github.com/SSSaaS/sssa-golang v0.0.0-20170502204618-d37d7782d752 h1:NMpC6M+PtNNDYpq7ozB7kINpv10L5yeli5GJpka2PX8= @@ -98,8 +96,6 @@ github.com/alecthomas/repr v0.0.0-20180818092828-117648cd9897 h1:p9Sln00KOTlrYkx github.com/alecthomas/repr v0.0.0-20180818092828-117648cd9897/go.mod h1:xTS7Pm1pD1mvyM075QCDSRqH6qRLXylzS24ZTpRiSzQ= github.com/alecthomas/template v0.0.0-20160405071501-a0175ee3bccc/go.mod h1:LOuyumcjzFXgccqObfd/Ljyb9UuFJ6TxHnclSeseNhc= github.com/alecthomas/units v0.0.0-20151022065526-2efee857e7cf/go.mod h1:ybxpYRFXyAe+OPACYpWeL0wqObRcbAqCMya13uyzqw0= -github.com/andybalholm/cascadia v1.0.0 h1:hOCXnnZ5A+3eVDX8pvgl4kofXv2ELss0bKcqRySc45o= -github.com/andybalholm/cascadia v1.0.0/go.mod h1:GsXiBklL0woXo1j/WYWtSYYC4ouU9PqHO0sqidkEA4Y= github.com/andybalholm/cascadia v1.1.0 h1:BuuO6sSfQNFRu1LppgbD25Hr2vLYW25JvxHs5zzsLTo= github.com/andybalholm/cascadia v1.1.0/go.mod h1:GsXiBklL0woXo1j/WYWtSYYC4ouU9PqHO0sqidkEA4Y= github.com/andygrunwald/go-gerrit v0.0.0-20181207071854-19ef3e9332a4/go.mod h1:0iuRQp6WJ44ts+iihy5E/WlPqfg5RNeQxOmzRkxCdtk= @@ -149,7 +145,6 @@ github.com/circonus-labs/circonusllhist v0.0.0-20180430145027-5eb751da55c6 h1:Rm github.com/circonus-labs/circonusllhist v0.0.0-20180430145027-5eb751da55c6/go.mod h1:kMXHVDlOchFAehlya5ePtbp5jckzBHf4XRpQvBOLI+I= github.com/client9/misspell v0.3.4/go.mod h1:qj6jICC3Q7zFZvVWo7KLAzC3yx5G7kyvSDkc90ppPyw= github.com/cncf/udpa/go v0.0.0-20191209042840-269d4d468f6f/go.mod h1:M8M6+tZqaGXZJjfX53e64911xZQV5JYwmTeXPW+k8Sc= -github.com/codegangsta/cli v1.20.0/go.mod h1:/qJNoX69yVSKu5o4jLyXAENLRyk1uhi7zkbQ3slBdOA= github.com/coreos/bbolt v1.3.2 h1:wZwiHHUieZCquLkDL0B8UhzreNWsPHooDAG3q34zk0s= github.com/coreos/bbolt v1.3.2/go.mod h1:iRUV2dpdMOn7Bo10OQBFzIJO9kkE559Wcmn+qkEiiKk= github.com/coreos/etcd v3.3.10+incompatible h1:jFneRYjIvLMLhDLCzuTuU4rSJUjRplcJQ7pD7MnhC04= @@ -177,8 +172,6 @@ github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSs github.com/dgrijalva/jwt-go v3.2.0+incompatible h1:7qlOGliEKZXTDg6OTjfoBKDXWrumCAMpl/TFQ4/5kLM= github.com/dgrijalva/jwt-go v3.2.0+incompatible/go.mod h1:E3ru+11k8xSBh+hMPgOLZmtrrCbhqsmaPHjLKYnJCaQ= github.com/dgryski/go-sip13 v0.0.0-20181026042036-e10d5fee7954/go.mod h1:vAd38F8PWV+bWy6jNmig1y/TA+kYO4g3RSRF0IAv0no= -github.com/digitalocean/godo v1.42.1 h1:SJ/XMVsp5CZmyQal8gLlOl9jSl1i3FaN20LlgtK5ZMs= -github.com/digitalocean/godo v1.42.1/go.mod h1:p7dOjjtSBqCTUksqtA5Fd3uaKs9kyTq2xcz76ulEJRU= github.com/digitalocean/godo v1.44.0 h1:IMElzMUpO1dVR8qjSg53+5vDkOLzMbhJt4yTAq7NGCQ= github.com/digitalocean/godo v1.44.0/go.mod h1:p7dOjjtSBqCTUksqtA5Fd3uaKs9kyTq2xcz76ulEJRU= github.com/dlclark/regexp2 v1.2.0 h1:8sAhBGEM0dRWogWqWyQeIJnxjWO6oIjl8FKqREDsGfk= @@ -539,8 +532,6 @@ github.com/mitchellh/mapstructure v1.1.2 h1:fmNYVwqnSfB9mZU6OS2O6GsXM+wcskZDuKQz github.com/mitchellh/mapstructure v1.1.2/go.mod h1:FVVH3fgwuzCH5S8UJGiWEs2h04kUh9fWfEaFds41c1Y= github.com/mitchellh/reflectwalk v1.0.0 h1:9D+8oIskB4VJBN5SFlmc27fSlIBZaov1Wpk/IfikLNY= github.com/mitchellh/reflectwalk v1.0.0/go.mod h1:mSTlrgnPZtwu0c4WaC2kGObEpuNDbx0jmZXqmk4esnw= -github.com/mmcdole/gofeed v1.0.0 h1:PHqwr8fsEm8xarj9s53XeEAFYhRM3E9Ib7Ie766/LTE= -github.com/mmcdole/gofeed v1.0.0/go.mod h1:tkVcyzS3qVMlQrQxJoEH1hkTiuo9a8emDzkMi7TZBu0= github.com/mmcdole/gofeed v1.1.0 h1:T2WrGLVJRV04PY2qwhEJLHCt9JiCtBhb6SmC8ZvJH08= github.com/mmcdole/gofeed v1.1.0/go.mod h1:PPiVwgDXLlz2N83KB4TrIim2lyYM5Zn7ZWH9Pi4oHUk= github.com/mmcdole/goxpp v0.0.0-20181012175147-0068e33feabf h1:sWGE2v+hO0Nd4yFU/S/mDBM5plIU8v/Qhfz41hkDIAI= @@ -681,8 +672,6 @@ github.com/sethgrid/pester v0.0.0-20171127025028-760f8913c048/go.mod h1:Ad7IjTpv github.com/sguiheux/go-coverage v0.0.0-20190710153556-287b082a7197 h1:qu90yDtRE5WEfRT5mn9v0Xz9RaopLguhbPwZKx4dHq8= github.com/sguiheux/go-coverage v0.0.0-20190710153556-287b082a7197/go.mod h1:0hhKrsUsoT7yvxwNGKa+TSYNA26DNWMqReeZEQq/9FI= github.com/shirou/gopsutil v0.0.0-20170406131756-e49a95f3d5f8/go.mod h1:5b4v6he4MtMOwMlS0TUMTu2PcXUg8+E1lC7eC3UO/RA= -github.com/shirou/gopsutil v2.20.7+incompatible h1:Ymv4OD12d6zm+2yONe39VSmp2XooJe8za7ngOLW/o/w= -github.com/shirou/gopsutil v2.20.7+incompatible/go.mod h1:5b4v6he4MtMOwMlS0TUMTu2PcXUg8+E1lC7eC3UO/RA= github.com/shirou/gopsutil v2.20.8+incompatible h1:8c7Atn0FAUZJo+f4wYbN0iVpdWniCQk7IYwGtgdh1mY= github.com/shirou/gopsutil v2.20.8+incompatible/go.mod h1:5b4v6he4MtMOwMlS0TUMTu2PcXUg8+E1lC7eC3UO/RA= github.com/shurcooL/sanitized_anchor_name v1.0.0/go.mod h1:1NzhyTcUVG4SuEtjjoZeVRXNmyL/1OwPU0+IJeTBvfc= @@ -753,8 +742,6 @@ github.com/wtfutil/spotigopher v0.0.0-20191127141047-7d8168fe103a/go.mod h1:AlO4 github.com/wtfutil/todoist v0.0.2-0.20191216004217-0ec29ceda61a h1:nD8ALd4TSo+zPHK5MqQWFj01G8fMMHFfC3rWvoq/9JA= github.com/wtfutil/todoist v0.0.2-0.20191216004217-0ec29ceda61a/go.mod h1:YuuGLJSsTK6DGBD5Zaf3J8LSMfpEC2WtzYPey3XVOdI= github.com/xanzy/go-gitlab v0.15.0/go.mod h1:8zdQa/ri1dfn8eS3Ir1SyfvOKlw7WBJ8DVThkpGiXrs= -github.com/xanzy/go-gitlab v0.33.0 h1:MUJZknbLhVXSFzBA5eqGGhQ2yHSu8tPbGBPeB3sN4B0= -github.com/xanzy/go-gitlab v0.33.0/go.mod h1:sPLojNBn68fMUWSxIJtdVVIP8uSBYqesTfDUseX11Ug= github.com/xanzy/go-gitlab v0.38.1 h1:st5/Ag4h8CqVfp3LpOWW0Jd4jYHTGETwu0KksYDPnYE= github.com/xanzy/go-gitlab v0.38.1/go.mod h1:sPLojNBn68fMUWSxIJtdVVIP8uSBYqesTfDUseX11Ug= github.com/xi2/xz v0.0.0-20171230120015-48954b6210f8/go.mod h1:HUYIGzjTL3rfEspMxjDjgmT5uz5wzYJKVo23qUhYTos= From 585f6cc64c8d6e760f2ba68322ce7d7c61d15762 Mon Sep 17 00:00:00 2001 From: Chris Cummer Date: Fri, 25 Sep 2020 06:55:58 -0700 Subject: [PATCH 08/42] Update CHANGELOG.md --- CHANGELOG.md | 3 +++ 1 file changed, 3 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index eeeb8012..774e6d95 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -8,6 +8,9 @@ * Updated `github.com/shirou/gopsutil` from 2.20.7+incompatible to 2.20.8+incompatible * Updated `github.com/mmcdole/gofeed` from 1.0.0 to 1.1.0 * Updated `github.com/digitalocean/godo` from 1.42.1 to 1.44.0 +* Updated `github.com/xanzy/go-gitlab` from 0.33.0 to 0.38.1 +* Updated `github.com/adlio/trello` from 1.7.0 to 1.8.0 +* Updated `github.com/alecthomas/chroma` from 0.8.0 to 0.8.1 ## v0.32.0 From 4a14acd89c779972b036a9f58d4701adf0bd84b9 Mon Sep 17 00:00:00 2001 From: Chris Cummer Date: Fri, 25 Sep 2020 06:56:42 -0700 Subject: [PATCH 09/42] go mod tidy Signed-off-by: Chris Cummer --- go.sum | 2 -- 1 file changed, 2 deletions(-) diff --git a/go.sum b/go.sum index 46db6d31..f9284260 100644 --- a/go.sum +++ b/go.sum @@ -82,8 +82,6 @@ github.com/StackExchange/wmi v0.0.0-20190523213315-cbe66965904d h1:G0m3OIz70MZUW github.com/StackExchange/wmi v0.0.0-20190523213315-cbe66965904d/go.mod h1:3eOhrUMpNV+6aFIbp5/iudMxNCF27Vw2OZgy4xEx0Fg= github.com/VictorAvelar/devto-api-go v1.0.0 h1:oXmzye3xYvlgBX18vX4+v6LVbjoihgIokpeOpzeJzqU= github.com/VictorAvelar/devto-api-go v1.0.0/go.mod h1:gX13cqzMdpo49qP8VtBR2uCnzW7d76LFrAVSX2eLifY= -github.com/adlio/trello v1.7.0 h1:syLRJ27wCM8URf7zOBWGr981cG+dpmLSyMqjEoQc+4g= -github.com/adlio/trello v1.7.0/go.mod h1:l2068AhUuUuQ9Vsb95ECMueHThYyAj4e85lWPmr2/LE= github.com/adlio/trello v1.8.0 h1:VU/1zwzuRzATsFC8WiK4f8R0HHQPWpf2H658KEchsmA= github.com/adlio/trello v1.8.0/go.mod h1:l2068AhUuUuQ9Vsb95ECMueHThYyAj4e85lWPmr2/LE= github.com/alecthomas/assert v0.0.0-20170929043011-405dbfeb8e38 h1:smF2tmSOzy2Mm+0dGI2AIUHY+w0BUc+4tn40djz7+6U= From 71a308b87f02451a452f48bb861c3986d5e64d58 Mon Sep 17 00:00:00 2001 From: "dependabot-preview[bot]" <27856297+dependabot-preview[bot]@users.noreply.github.com> Date: Fri, 25 Sep 2020 06:57:56 -0700 Subject: [PATCH 10/42] Bump github.com/alecthomas/chroma from 0.8.0 to 0.8.1 (#971) Bumps [github.com/alecthomas/chroma](https://github.com/alecthomas/chroma) from 0.8.0 to 0.8.1. - [Release notes](https://github.com/alecthomas/chroma/releases) - [Changelog](https://github.com/alecthomas/chroma/blob/master/.goreleaser.yml) - [Commits](https://github.com/alecthomas/chroma/compare/v0.8.0...v0.8.1) Signed-off-by: dependabot-preview[bot] Co-authored-by: dependabot-preview[bot] <27856297+dependabot-preview[bot]@users.noreply.github.com> Co-authored-by: Chris Cummer --- go.mod | 2 +- go.sum | 2 ++ 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/go.mod b/go.mod index 94446e69..76770110 100644 --- a/go.mod +++ b/go.mod @@ -9,8 +9,8 @@ require ( github.com/PagerDuty/go-pagerduty v0.0.0-20191002190746-f60f4fc45222 github.com/StackExchange/wmi v0.0.0-20190523213315-cbe66965904d // indirect github.com/VictorAvelar/devto-api-go v1.0.0 + github.com/alecthomas/chroma v0.8.1 github.com/adlio/trello v1.8.0 - github.com/alecthomas/chroma v0.8.0 github.com/andygrunwald/go-gerrit v0.0.0-20190825170856-5959a9bf9ff8 github.com/briandowns/openweathermap v0.0.0-20180804155945-5f41b7c9d92d github.com/cenkalti/backoff v2.2.1+incompatible // indirect diff --git a/go.sum b/go.sum index f9284260..ba972c89 100644 --- a/go.sum +++ b/go.sum @@ -88,6 +88,8 @@ github.com/alecthomas/assert v0.0.0-20170929043011-405dbfeb8e38 h1:smF2tmSOzy2Mm github.com/alecthomas/assert v0.0.0-20170929043011-405dbfeb8e38/go.mod h1:r7bzyVFMNntcxPZXK3/+KdruV1H5KSlyVY0gc+NgInI= github.com/alecthomas/chroma v0.8.0 h1:HS+HE97sgcqjQGu5uVr8jIE55Mmh5UeQ7kckAhHg2pY= github.com/alecthomas/chroma v0.8.0/go.mod h1:sko8vR34/90zvl5QdcUdvzL3J8NKjAUx9va9jPuFNoM= +github.com/alecthomas/chroma v0.8.1 h1:ym20sbvyC6RXz45u4qDglcgr8E313oPROshcuCHqiEE= +github.com/alecthomas/chroma v0.8.1/go.mod h1:sko8vR34/90zvl5QdcUdvzL3J8NKjAUx9va9jPuFNoM= github.com/alecthomas/colour v0.0.0-20160524082231-60882d9e2721 h1:JHZL0hZKJ1VENNfmXvHbgYlbUOvpzYzvy2aZU5gXVeo= github.com/alecthomas/colour v0.0.0-20160524082231-60882d9e2721/go.mod h1:QO9JBoKquHd+jz9nshCh40fOfO+JzsoXy8qTHF68zU0= github.com/alecthomas/jsonschema v0.0.0-20200123075451-43663a393755/go.mod h1:Juc2PrI3wtNfUwptSvAIeNx+HrETwHQs6nf+TkOJlOA= From 787d27b498d9732ac64cd0aa6c57ef34b0c08f52 Mon Sep 17 00:00:00 2001 From: Chris Cummer Date: Fri, 25 Sep 2020 06:58:09 -0700 Subject: [PATCH 11/42] go mod tidy Signed-off-by: Chris Cummer --- go.mod | 2 +- go.sum | 2 -- 2 files changed, 1 insertion(+), 3 deletions(-) diff --git a/go.mod b/go.mod index 76770110..d6ef57a8 100644 --- a/go.mod +++ b/go.mod @@ -9,8 +9,8 @@ require ( github.com/PagerDuty/go-pagerduty v0.0.0-20191002190746-f60f4fc45222 github.com/StackExchange/wmi v0.0.0-20190523213315-cbe66965904d // indirect github.com/VictorAvelar/devto-api-go v1.0.0 - github.com/alecthomas/chroma v0.8.1 github.com/adlio/trello v1.8.0 + github.com/alecthomas/chroma v0.8.1 github.com/andygrunwald/go-gerrit v0.0.0-20190825170856-5959a9bf9ff8 github.com/briandowns/openweathermap v0.0.0-20180804155945-5f41b7c9d92d github.com/cenkalti/backoff v2.2.1+incompatible // indirect diff --git a/go.sum b/go.sum index ba972c89..33c9cdca 100644 --- a/go.sum +++ b/go.sum @@ -86,8 +86,6 @@ github.com/adlio/trello v1.8.0 h1:VU/1zwzuRzATsFC8WiK4f8R0HHQPWpf2H658KEchsmA= github.com/adlio/trello v1.8.0/go.mod h1:l2068AhUuUuQ9Vsb95ECMueHThYyAj4e85lWPmr2/LE= github.com/alecthomas/assert v0.0.0-20170929043011-405dbfeb8e38 h1:smF2tmSOzy2Mm+0dGI2AIUHY+w0BUc+4tn40djz7+6U= github.com/alecthomas/assert v0.0.0-20170929043011-405dbfeb8e38/go.mod h1:r7bzyVFMNntcxPZXK3/+KdruV1H5KSlyVY0gc+NgInI= -github.com/alecthomas/chroma v0.8.0 h1:HS+HE97sgcqjQGu5uVr8jIE55Mmh5UeQ7kckAhHg2pY= -github.com/alecthomas/chroma v0.8.0/go.mod h1:sko8vR34/90zvl5QdcUdvzL3J8NKjAUx9va9jPuFNoM= github.com/alecthomas/chroma v0.8.1 h1:ym20sbvyC6RXz45u4qDglcgr8E313oPROshcuCHqiEE= github.com/alecthomas/chroma v0.8.1/go.mod h1:sko8vR34/90zvl5QdcUdvzL3J8NKjAUx9va9jPuFNoM= github.com/alecthomas/colour v0.0.0-20160524082231-60882d9e2721 h1:JHZL0hZKJ1VENNfmXvHbgYlbUOvpzYzvy2aZU5gXVeo= From 5e44a01699c8d412f54864addf223a76e4ec150a Mon Sep 17 00:00:00 2001 From: Chris Cummer Date: Tue, 29 Sep 2020 10:06:43 -0700 Subject: [PATCH 12/42] Sort exchange rates alphabetically and group same base rates by row color Before this, exchange rates were read from a map, which meant the display order was random. This ensures that the list of exchange rates displays in a consistent order and visually denotes rates for the same currency. Signed-off-by: Chris Cummer --- modules/exchangerates/widget.go | 18 +++++++++++++++--- 1 file changed, 15 insertions(+), 3 deletions(-) diff --git a/modules/exchangerates/widget.go b/modules/exchangerates/widget.go index c243daa2..59e85a07 100644 --- a/modules/exchangerates/widget.go +++ b/modules/exchangerates/widget.go @@ -3,6 +3,7 @@ package exchangerates import ( "fmt" "regexp" + "sort" "github.com/rivo/tview" "github.com/wtfutil/wtf/view" @@ -56,15 +57,26 @@ func (widget *Widget) content() (string, string, bool) { return widget.CommonSettings().Title, widget.err.Error(), false } + // Sort the bases alphabetically to ensure consistent display ordering + bases := []string{} + for base := range widget.settings.rates { + bases = append(bases, base) + } + sort.Strings(bases) + out := "" - idx := 0 - for base, rates := range widget.settings.rates { + + for idx, base := range bases { + rates := widget.settings.rates[base] + + rowColor := widget.CommonSettings().RowColor(idx) + for _, cur := range rates { rate := widget.rates[base][cur] out += fmt.Sprintf( "[%s]1 %s = %s %s[white]\n", - widget.CommonSettings().RowColor(idx), + rowColor, base, widget.formatConversionRate(rate), cur, From e56b8693a23cae4f7915cda5022151405fcb4cb1 Mon Sep 17 00:00:00 2001 From: Chris Cummer Date: Tue, 29 Sep 2020 10:10:37 -0700 Subject: [PATCH 13/42] Update CHANGELOG.md --- CHANGELOG.md | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 774e6d95..d6c7987c 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,6 +2,10 @@ ## Unreleased +### 🐞 Fixed + +* Exchange Rates module now displays rates in alphabetical order, sorted by the base rate, by [@senorprogrammer](https://github.com/senorprogrammer) + ### 👍 Updated * Updated `github.com/gdamore/tcell` from 1.3.0 to 1.4.0 From c4ca3d9b2a5207e3c706a1958b2994d88cd3faa3 Mon Sep 17 00:00:00 2001 From: Ying Fan Chong Date: Thu, 1 Oct 2020 22:12:31 +0800 Subject: [PATCH 14/42] Add capability to switch content between title, link and title+content --- go.mod | 2 ++ go.sum | 4 +++ modules/feedreader/keyboard.go | 1 + modules/feedreader/widget.go | 46 +++++++++++++++++++++++++++++++++- 4 files changed, 52 insertions(+), 1 deletion(-) diff --git a/go.mod b/go.mod index d6ef57a8..c4450db0 100644 --- a/go.mod +++ b/go.mod @@ -56,6 +56,7 @@ require ( github.com/spf13/cobra v0.0.5 // indirect github.com/spf13/pflag v1.0.5 // indirect github.com/spf13/viper v1.6.1 // indirect + github.com/ssor/bom v0.0.0-20170718123548-6386211fdfcf // indirect github.com/stretchr/testify v1.6.1 github.com/wtfutil/spotigopher v0.0.0-20191127141047-7d8168fe103a github.com/wtfutil/todoist v0.0.2-0.20191216004217-0ec29ceda61a @@ -69,6 +70,7 @@ require ( gopkg.in/jarcoal/httpmock.v1 v1.0.0-20181110093347-3be5f16b70eb // indirect gopkg.in/yaml.v2 v2.3.0 gotest.tools v2.2.0+incompatible + jaytaylor.com/html2text v0.0.0-20200412013138-3577fbdbcff7 k8s.io/apimachinery v0.0.0-20190223094358-dcb391cde5ca k8s.io/client-go v10.0.0+incompatible ) diff --git a/go.sum b/go.sum index 33c9cdca..5f1f9853 100644 --- a/go.sum +++ b/go.sum @@ -707,6 +707,8 @@ github.com/spf13/viper v1.3.2/go.mod h1:ZiWeW+zYFKm7srdB9IoDzzZXaJaI5eL9QjNiN/DM github.com/spf13/viper v1.4.0/go.mod h1:PTJ7Z/lr49W6bUbkmS1V3by4uWynFiR9p7+dSq/yZzE= github.com/spf13/viper v1.6.1 h1:VPZzIkznI1YhVMRi6vNFLHSwhnhReBfgTxIPccpfdZk= github.com/spf13/viper v1.6.1/go.mod h1:t3iDnF5Jlj76alVNuyFBk5oUMCvsrkbvZK0WQdfDi5k= +github.com/ssor/bom v0.0.0-20170718123548-6386211fdfcf h1:pvbZ0lM0XWPBqUKqFU8cmavspvIl9nulOYwdy6IFRRo= +github.com/ssor/bom v0.0.0-20170718123548-6386211fdfcf/go.mod h1:RJID2RhlZKId02nZ62WenDCkgHFerpIOmW0iT7GKmXM= github.com/streadway/amqp v0.0.0-20180528204448-e5adc2ada8b8 h1:l6epF6yBwuejBfhGkM5m8VSNM/QAm7ApGyH35ehA7eQ= github.com/streadway/amqp v0.0.0-20180528204448-e5adc2ada8b8/go.mod h1:1WNBiOZtZQLpVAyu0iTduoJL9hEsMloAK5XWrtW0xdY= github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME= @@ -1128,6 +1130,8 @@ honnef.co/go/tools v0.0.1-2019.2.3/go.mod h1:a3bituU0lyd329TUQxRnasdCoJDkEUEAqEt honnef.co/go/tools v0.0.1-2020.1.3 h1:sXmLre5bzIR6ypkjXCDI3jHPssRhc8KD/Ome589sc3U= honnef.co/go/tools v0.0.1-2020.1.3/go.mod h1:X/FiERA/W4tHapMX5mGpAtMSVEeEUOyHaw9vFzvIQ3k= honnef.co/go/tools v0.0.1-2020.1.4/go.mod h1:X/FiERA/W4tHapMX5mGpAtMSVEeEUOyHaw9vFzvIQ3k= +jaytaylor.com/html2text v0.0.0-20200412013138-3577fbdbcff7 h1:mub0MmFLOn8XLikZOAhgLD1kXJq8jgftSrrv7m00xFo= +jaytaylor.com/html2text v0.0.0-20200412013138-3577fbdbcff7/go.mod h1:OxvTsCwKosqQ1q7B+8FwXqg4rKZ/UG9dUW+g/VL2xH4= k8s.io/api v0.0.0-20181204000039-89a74a8d264d h1:HQoGWsWUe/FmRcX9BU440AAMnzBFEf+DBo4nbkQlNzs= k8s.io/api v0.0.0-20181204000039-89a74a8d264d/go.mod h1:iuAfoD4hCxJ8Onx9kaTIt30j7jUFS00AXQi6QMi99vA= k8s.io/apimachinery v0.0.0-20190223094358-dcb391cde5ca h1:rOczZwIfERvL7YLSQ96uI3NUYamzdK/MmSDIfChQRBk= diff --git a/modules/feedreader/keyboard.go b/modules/feedreader/keyboard.go index 4c17aaa3..35661948 100644 --- a/modules/feedreader/keyboard.go +++ b/modules/feedreader/keyboard.go @@ -8,6 +8,7 @@ func (widget *Widget) initializeKeyboardControls() { widget.SetKeyboardChar("j", widget.Next, "Select next item") widget.SetKeyboardChar("k", widget.Prev, "Select previous item") widget.SetKeyboardChar("o", widget.openStory, "Open story in browser") + widget.SetKeyboardChar("t", widget.toggleDisplayText, "Toggle between title and URL") widget.SetKeyboardKey(tcell.KeyDown, widget.Next, "Select next item") widget.SetKeyboardKey(tcell.KeyUp, widget.Prev, "Select previous item") diff --git a/modules/feedreader/widget.go b/modules/feedreader/widget.go index ce92ce9e..ce508eb0 100644 --- a/modules/feedreader/widget.go +++ b/modules/feedreader/widget.go @@ -3,13 +3,23 @@ package feedreader import ( "fmt" "sort" + "strings" + "jaytaylor.com/html2text" "github.com/mmcdole/gofeed" "github.com/rivo/tview" "github.com/wtfutil/wtf/utils" "github.com/wtfutil/wtf/view" ) +type ShowType int + +const ( + SHOW_TITLE ShowType = iota + SHOW_LINK + SHOW_CONTENT +) + // FeedItem represents an item returned from an RSS or Atom feed type FeedItem struct { item *gofeed.Item @@ -25,6 +35,32 @@ type Widget struct { parser *gofeed.Parser settings *Settings err error + showType ShowType +} + +func rotateShowType(showtype ShowType) ShowType { + returnValue := SHOW_TITLE + switch showtype { + case SHOW_TITLE: + returnValue = SHOW_LINK + case SHOW_LINK: + returnValue = SHOW_CONTENT + case SHOW_CONTENT: + returnValue = SHOW_TITLE + } + return returnValue +} + +func getShowText(feedItem *FeedItem, showType ShowType) string { + returnValue := feedItem.item.Title + switch showType { + case SHOW_LINK: + returnValue = feedItem.item.Link + case SHOW_CONTENT: + text, _ := html2text.FromString(feedItem.item.Content, html2text.Options{PrettyTables: true}) + returnValue = feedItem.item.Title + "\n" + strings.TrimSpace(text) + } + return returnValue } // NewWidget creates a new instance of a widget @@ -35,6 +71,7 @@ func NewWidget(app *tview.Application, pages *tview.Pages, settings *Settings) * parser: gofeed.NewParser(), settings: settings, + showType: SHOW_TITLE, } widget.SetRenderFunction(widget.Render) @@ -137,11 +174,13 @@ func (widget *Widget) content() (string, string, bool) { } } + displayText := getShowText(feedItem, widget.showType) + row := fmt.Sprintf( "[%s]%2d. %s[white]", rowColor, idx+1, - feedItem.item.Title, + displayText, ) str += utils.HighlightableHelper(widget.View, row, idx, len(feedItem.item.Title)) @@ -169,3 +208,8 @@ func (widget *Widget) openStory() { utils.OpenFile(story.item.Link) } } + +func (widget *Widget) toggleDisplayText() { + widget.showType = rotateShowType(widget.showType) + widget.Render() +} From 184b3744c2709ef805e87461f4e1e3befd4a37c4 Mon Sep 17 00:00:00 2001 From: Ying Fan Chong Date: Thu, 1 Oct 2020 22:16:19 +0800 Subject: [PATCH 15/42] Apply gofmt --- modules/feedreader/widget.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/modules/feedreader/widget.go b/modules/feedreader/widget.go index ce508eb0..33e17af3 100644 --- a/modules/feedreader/widget.go +++ b/modules/feedreader/widget.go @@ -5,11 +5,11 @@ import ( "sort" "strings" - "jaytaylor.com/html2text" "github.com/mmcdole/gofeed" "github.com/rivo/tview" "github.com/wtfutil/wtf/utils" "github.com/wtfutil/wtf/view" + "jaytaylor.com/html2text" ) type ShowType int From bdf642b7734787c7b7f2a06675ef4c987a19aaeb Mon Sep 17 00:00:00 2001 From: Ying Fan Chong Date: Thu, 1 Oct 2020 22:24:33 +0800 Subject: [PATCH 16/42] Fix help text --- modules/feedreader/keyboard.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/modules/feedreader/keyboard.go b/modules/feedreader/keyboard.go index 35661948..d47718c5 100644 --- a/modules/feedreader/keyboard.go +++ b/modules/feedreader/keyboard.go @@ -8,7 +8,7 @@ func (widget *Widget) initializeKeyboardControls() { widget.SetKeyboardChar("j", widget.Next, "Select next item") widget.SetKeyboardChar("k", widget.Prev, "Select previous item") widget.SetKeyboardChar("o", widget.openStory, "Open story in browser") - widget.SetKeyboardChar("t", widget.toggleDisplayText, "Toggle between title and URL") + widget.SetKeyboardChar("t", widget.toggleDisplayText, "Toggle display between title, link and title+content") widget.SetKeyboardKey(tcell.KeyDown, widget.Next, "Select next item") widget.SetKeyboardKey(tcell.KeyUp, widget.Prev, "Select previous item") From edf0aa5c1412a13aa4dfb9720ae84d4a21f1c5f8 Mon Sep 17 00:00:00 2001 From: Chris Cummer Date: Fri, 2 Oct 2020 04:10:46 -0700 Subject: [PATCH 17/42] Add @cyingfan as a contributor --- .all-contributorsrc | 7 +++++++ README.md | 1 + 2 files changed, 8 insertions(+) diff --git a/.all-contributorsrc b/.all-contributorsrc index bf3a49ba..82b2e520 100644 --- a/.all-contributorsrc +++ b/.all-contributorsrc @@ -959,6 +959,13 @@ "name": "Tim Hwang", "avatar_url": "https://avatars3.githubusercontent.com/u/5831434?v=4", "profile": "http://timhwang21.gitbook.io", + "contributions": [] + }, + { + "login": "cyingfan", + "name": "Ying Fan Chong", + "avatar_url": "https://avatars1.githubusercontent.com/u/10404961?v=4", + "profile": "http://about.me/yingfan", "contributions": [ ] } diff --git a/README.md b/README.md index ecb3c504..6db4d8a2 100644 --- a/README.md +++ b/README.md @@ -396,6 +396,7 @@ Dependency management in WTF is handled by [Go modules](https://github.com/golan
Frederik Mogensen


aeter


Tim Hwang

+
Ying Fan Chong

From 772bea01524fec27ee00cdc62a5b286f59e23058 Mon Sep 17 00:00:00 2001 From: Chris Cummer Date: Fri, 2 Oct 2020 04:12:47 -0700 Subject: [PATCH 18/42] Update CHANGELOG.md --- CHANGELOG.md | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index d6c7987c..cd934c6d 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,6 +2,10 @@ ## Unreleased +### ⚡️ Added + +* FeedReader module supports [display mode switching](https://github.com/wtfutil/wtf/pull/976) via the `t` key, by [@cyingfan](https://github.com/cyingfan) + ### 🐞 Fixed * Exchange Rates module now displays rates in alphabetical order, sorted by the base rate, by [@senorprogrammer](https://github.com/senorprogrammer) From 9a366ffeb9912e75b3ed422086a078b90442425e Mon Sep 17 00:00:00 2001 From: Ying Fan Chong Date: Fri, 2 Oct 2020 20:35:20 +0800 Subject: [PATCH 19/42] Fix sorting for feed without published date --- modules/feedreader/widget.go | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/modules/feedreader/widget.go b/modules/feedreader/widget.go index 33e17af3..af33ac0e 100644 --- a/modules/feedreader/widget.go +++ b/modules/feedreader/widget.go @@ -58,7 +58,7 @@ func getShowText(feedItem *FeedItem, showType ShowType) string { returnValue = feedItem.item.Link case SHOW_CONTENT: text, _ := html2text.FromString(feedItem.item.Content, html2text.Options{PrettyTables: true}) - returnValue = feedItem.item.Title + "\n" + strings.TrimSpace(text) + returnValue = strings.TrimSpace(feedItem.item.Title + "\n" + strings.TrimSpace(text)) } return returnValue } @@ -192,7 +192,9 @@ func (widget *Widget) content() (string, string, bool) { // feedItems are sorted by published date func (widget *Widget) sort(feedItems []*FeedItem) []*FeedItem { sort.Slice(feedItems, func(i, j int) bool { - return feedItems[i].item.PublishedParsed.After(*feedItems[j].item.PublishedParsed) + return feedItems[i].item.PublishedParsed != nil && + feedItems[j].item.PublishedParsed != nil && + feedItems[i].item.PublishedParsed.After(*feedItems[j].item.PublishedParsed) }) return feedItems From 0f36063696eb53619f1d1d311c6940c8fc990a50 Mon Sep 17 00:00:00 2001 From: Ying Fan Chong Date: Fri, 2 Oct 2020 20:53:33 +0800 Subject: [PATCH 20/42] Prevent extra empty line in highlightable text --- view/text_widget.go | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/view/text_widget.go b/view/text_widget.go index 7aa94eb8..09f92df4 100644 --- a/view/text_widget.go +++ b/view/text_widget.go @@ -1,6 +1,8 @@ package view import ( + "strings" + "github.com/rivo/tview" "github.com/wtfutil/wtf/cfg" "github.com/wtfutil/wtf/wtf" @@ -36,7 +38,7 @@ func (widget *TextWidget) Redraw(data func() (string, string, bool)) { widget.View.Clear() widget.View.SetWrap(wrap) widget.View.SetTitle(widget.ContextualTitle(title)) - widget.View.SetText(content) + widget.View.SetText(strings.TrimSpace(content)) }) } From 2b10f8de88bde38c8c8c4233c07acbc5f1b66a39 Mon Sep 17 00:00:00 2001 From: Chris Cummer Date: Sat, 3 Oct 2020 06:01:23 -0700 Subject: [PATCH 21/42] Update CHANGELOG.md --- CHANGELOG.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index cd934c6d..9a31e6f8 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -9,6 +9,8 @@ ### 🐞 Fixed * Exchange Rates module now displays rates in alphabetical order, sorted by the base rate, by [@senorprogrammer](https://github.com/senorprogrammer) +* Feed Reader module no longer crashes on feeds that don't have a published date, [#958](https://github.com/wtfutil/wtf/issues/958) by [@cyingfan](https://github.com/cyingfan) +* Stray blank lines no longer appear at the end of highlightable lists, [#977](https://github.com/wtfutil/wtf/pull/977) by [@cyingfan](https://github.com/cyingfan) ### 👍 Updated From aa8ed14a1b82601e9f86762c37abf00c7d9e8c77 Mon Sep 17 00:00:00 2001 From: Jamie Tanna Date: Sat, 3 Oct 2020 14:04:46 +0100 Subject: [PATCH 22/42] Document how to install on Arch (#978) --- README.md | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/README.md b/README.md index 6db4d8a2..bec80709 100644 --- a/README.md +++ b/README.md @@ -130,6 +130,10 @@ docker rm wtf_build **Note:** WTF is _only_ compatible with Go versions **1.12.0** or later (due to the use of Go modules and newer standard library functions). If you would like to use `gccgo` to compile, you _must_ use `gccgo-9` or later which introduces support for Go modules. +### Installing via Arch User Repository + +Arch Linux users can utilise the [wtfutil](https://aur.archlinux.org/packages/wtfutil) package to build it from source, or [wtfutil-bin](https://aur.archlinux.org/packages/wtfutil-bin/) to install pre-built binaries. + ## Running via Docker You can run `wtf` inside a docker container: From c9d65fd7e718b492bd448c1b5b4b4f8733fa6095 Mon Sep 17 00:00:00 2001 From: Chris Cummer Date: Sat, 3 Oct 2020 06:05:15 -0700 Subject: [PATCH 23/42] Add @MartinJohns as a contributor --- .all-contributorsrc | 8 ++++++++ README.md | 1 + 2 files changed, 9 insertions(+) diff --git a/.all-contributorsrc b/.all-contributorsrc index 82b2e520..f95dfcd7 100644 --- a/.all-contributorsrc +++ b/.all-contributorsrc @@ -966,7 +966,15 @@ "name": "Ying Fan Chong", "avatar_url": "https://avatars1.githubusercontent.com/u/10404961?v=4", "profile": "http://about.me/yingfan", + "contributions": [] + }, + { + "login": "MartinJohns", + "name": "Martin Johns", + "avatar_url": "https://avatars1.githubusercontent.com/u/5269069?v=4", + "profile": "https://github.com/MartinJohns", "contributions": [ + "code" ] } ], diff --git a/README.md b/README.md index 6db4d8a2..d7fdc141 100644 --- a/README.md +++ b/README.md @@ -397,6 +397,7 @@ Dependency management in WTF is handled by [Go modules](https://github.com/golan
aeter


Tim Hwang


Ying Fan Chong

+
Martin Johns

💻 From 04f62d3de8990d130394cb43b0ccbdef45bdf3a0 Mon Sep 17 00:00:00 2001 From: Chris Cummer Date: Sat, 3 Oct 2020 06:05:26 -0700 Subject: [PATCH 24/42] Add @jamietanna as a contributor --- .all-contributorsrc | 9 ++++++++- README.md | 3 ++- 2 files changed, 10 insertions(+), 2 deletions(-) diff --git a/.all-contributorsrc b/.all-contributorsrc index f95dfcd7..e065e25a 100644 --- a/.all-contributorsrc +++ b/.all-contributorsrc @@ -974,7 +974,14 @@ "avatar_url": "https://avatars1.githubusercontent.com/u/5269069?v=4", "profile": "https://github.com/MartinJohns", "contributions": [ - "code" + ] + }, + { + "login": "jamietanna", + "name": "Jamie Tanna", + "avatar_url": "https://avatars0.githubusercontent.com/u/3315059?v=4", + "profile": "https://www.jvt.me", + "contributions": [ ] } ], diff --git a/README.md b/README.md index d7fdc141..04de5202 100644 --- a/README.md +++ b/README.md @@ -397,7 +397,8 @@ Dependency management in WTF is handled by [Go modules](https://github.com/golan
aeter


Tim Hwang


Ying Fan Chong

-
Martin Johns

💻 +
Martin Johns

+
Jamie Tanna

From cab3f9c65810ff1e01357a20332cdb37dfbe9fce Mon Sep 17 00:00:00 2001 From: Sean Smith Date: Sat, 3 Oct 2020 12:24:41 -0400 Subject: [PATCH 25/42] Upgrade to golang 1.15 (#980) --- Dockerfile | 2 +- Dockerfile.build | 2 +- go.mod | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/Dockerfile b/Dockerfile index 8865afb4..0a17d2ca 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,4 +1,4 @@ -FROM golang:1.13-alpine as build +FROM golang:1.15-alpine as build ARG version=master diff --git a/Dockerfile.build b/Dockerfile.build index 7e672aab..645b4d86 100644 --- a/Dockerfile.build +++ b/Dockerfile.build @@ -1,4 +1,4 @@ -FROM golang:1.13 as build +FROM golang:1.15 as build ARG version=master diff --git a/go.mod b/go.mod index c4450db0..2ff4943d 100644 --- a/go.mod +++ b/go.mod @@ -1,6 +1,6 @@ module github.com/wtfutil/wtf -go 1.14 +go 1.15 require ( code.cloudfoundry.org/bytefmt v0.0.0-20190819182555-854d396b647c From f2517b3e64ab0e3ddc50a321ecc31d5993a654d4 Mon Sep 17 00:00:00 2001 From: Chris Cummer Date: Sat, 3 Oct 2020 09:26:34 -0700 Subject: [PATCH 26/42] Update CHANGELOG.md --- CHANGELOG.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 9a31e6f8..030fec89 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -22,6 +22,8 @@ * Updated `github.com/adlio/trello` from 1.7.0 to 1.8.0 * Updated `github.com/alecthomas/chroma` from 0.8.0 to 0.8.1 +* Now requires Go 1.15 for compilation in Dockerfiles and go.mod, by [@seanstoppable](https://github.com/Seanstoppable) + ## v0.32.0 ### ⚡️ Added From fcc2a211dfa421344367bb2d3830dd62b3f4b6aa Mon Sep 17 00:00:00 2001 From: Sean Smith Date: Sat, 3 Oct 2020 13:10:50 -0400 Subject: [PATCH 27/42] Add natural ordering for clocks This turns locations into an ordered array, so we can have a 'natural' ordering This is backwards compatible Resolves #896 --- modules/clocks/clock.go | 13 ++++++++++ modules/clocks/clock_collection.go | 4 ++- modules/clocks/settings.go | 41 ++++++++++++++++++++++++++---- modules/clocks/widget.go | 20 +++------------ 4 files changed, 55 insertions(+), 23 deletions(-) diff --git a/modules/clocks/clock.go b/modules/clocks/clock.go index f2a16f71..38ec9eb9 100644 --- a/modules/clocks/clock.go +++ b/modules/clocks/clock.go @@ -1,6 +1,7 @@ package clocks import ( + "strings" "time" ) @@ -18,6 +19,14 @@ func NewClock(label string, timeLoc *time.Location) Clock { return clock } +func BuildClock(label string, location string) (clock Clock, err error) { + timeLoc, err := time.LoadLocation(sanitizeLocation(location)) + if err != nil { + return Clock{}, err + } + return NewClock(label, timeLoc), nil +} + func (clock *Clock) Date(dateFormat string) string { return clock.LocalTime().Format(dateFormat) } @@ -33,3 +42,7 @@ func (clock *Clock) ToLocal(t time.Time) time.Time { func (clock *Clock) Time(timeFormat string) string { return clock.LocalTime().Format(timeFormat) } + +func sanitizeLocation(locStr string) string { + return strings.Replace(locStr, " ", "_", -1) +} diff --git a/modules/clocks/clock_collection.go b/modules/clocks/clock_collection.go index 754a3f4c..471c0b9a 100644 --- a/modules/clocks/clock_collection.go +++ b/modules/clocks/clock_collection.go @@ -10,7 +10,9 @@ type ClockCollection struct { } func (clocks *ClockCollection) Sorted(sortOrder string) []Clock { - if sortOrder == "chronological" { + if sortOrder == "natural" { + //no-op + } else if sortOrder == "chronological" { clocks.SortedChronologically() } else { clocks.SortedAlphabetically() diff --git a/modules/clocks/settings.go b/modules/clocks/settings.go index 4106dcaf..28c0068f 100644 --- a/modules/clocks/settings.go +++ b/modules/clocks/settings.go @@ -15,10 +15,10 @@ const ( type Settings struct { common *cfg.Common - dateFormat string `help:"The format of the date string for all clocks." values:"Any valid Go date layout which is handled by Time.Format. Defaults to Jan 2."` - timeFormat string `help:"The format of the time string for all clocks." values:"Any valid Go time layout which is handled by Time.Format. Defaults to 15:04 MST."` - locations map[string]interface{} `help:"Defines the timezones for the world clocks that you want to display. key is a unique label that will be displayed in the UI. value is a timezone name." values:"Any TZ database timezone."` - sort string `help:"Defines the display order of the clocks in the widget." values:"'alphabetical' or 'chronological'. 'alphabetical' will sort in acending order by key, 'chronological' will sort in ascending order by date/time."` + dateFormat string `help:"The format of the date string for all clocks." values:"Any valid Go date layout which is handled by Time.Format. Defaults to Jan 2."` + timeFormat string `help:"The format of the time string for all clocks." values:"Any valid Go time layout which is handled by Time.Format. Defaults to 15:04 MST."` + locations []Clock `help:"Defines the timezones for the world clocks that you want to display. key is a unique label that will be displayed in the UI. value is a timezone name." values:"Any TZ database timezone."` + sort string `help:"Defines the display order of the clocks in the widget." values:"'alphabetical', 'chronological', or 'natural. 'alphabetical' will sort in acending order by key, 'chronological' will sort in ascending order by date/time, 'natural' will keep ordering as per the config."` } // NewSettingsFromYAML creates a new settings instance from a YAML config block @@ -28,9 +28,40 @@ func NewSettingsFromYAML(name string, ymlConfig *config.Config, globalConfig *co dateFormat: ymlConfig.UString("dateFormat", utils.SimpleDateFormat), timeFormat: ymlConfig.UString("timeFormat", utils.SimpleTimeFormat), - locations: ymlConfig.UMap("locations"), + locations: buildLocations(ymlConfig), sort: ymlConfig.UString("sort"), } return &settings } + +func buildLocations(ymlConfig *config.Config) []Clock { + clocks := []Clock{} + locations, err := ymlConfig.Map("locations") + if err == nil { + for k, v := range locations { + name := k + zone := v.(string) + clock, err := BuildClock(name, zone) + if err == nil { + clocks = append(clocks, clock) + } + } + return clocks + } + + listLocations := ymlConfig.UList("locations") + for _, location := range listLocations { + if location, ok := location.(map[string]interface{}); ok { + for k, v := range location { + name := k + zone := v.(string) + clock, err := BuildClock(name, zone) + if err == nil { + clocks = append(clocks, clock) + } + } + } + } + return clocks +} diff --git a/modules/clocks/widget.go b/modules/clocks/widget.go index 5fd10f54..24c317b2 100644 --- a/modules/clocks/widget.go +++ b/modules/clocks/widget.go @@ -1,9 +1,6 @@ package clocks import ( - "strings" - "time" - "github.com/rivo/tview" "github.com/wtfutil/wtf/view" ) @@ -28,7 +25,7 @@ func NewWidget(app *tview.Application, settings *Settings) *Widget { timeFormat: settings.timeFormat, } - widget.clockColl = widget.buildClockCollection(settings.locations) + widget.clockColl = widget.buildClockCollection() return &widget } @@ -45,21 +42,10 @@ func (widget *Widget) Refresh() { /* -------------------- Unexported Functions -------------------- */ -func (widget *Widget) buildClockCollection(locData map[string]interface{}) ClockCollection { +func (widget *Widget) buildClockCollection() ClockCollection { clockColl := ClockCollection{} - for label, locStr := range locData { - timeLoc, err := time.LoadLocation(widget.sanitizeLocation(locStr.(string))) - if err != nil { - continue - } - - clockColl.Clocks = append(clockColl.Clocks, NewClock(label, timeLoc)) - } + clockColl.Clocks = widget.settings.locations return clockColl } - -func (widget *Widget) sanitizeLocation(locStr string) string { - return strings.Replace(locStr, " ", "_", -1) -} From 2537a7f49ac59a8376fe41c184524a1302a07c2a Mon Sep 17 00:00:00 2001 From: Ying Fan Chong Date: Sun, 4 Oct 2020 20:53:27 +0800 Subject: [PATCH 28/42] Fix config file path --- cfg/config_files.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/cfg/config_files.go b/cfg/config_files.go index 184af654..cf65dec3 100644 --- a/cfg/config_files.go +++ b/cfg/config_files.go @@ -37,7 +37,7 @@ func CreateFile(fileName string) (string, error) { return "", err } - filePath := fmt.Sprintf("%s/%s", configDir, fileName) + filePath := filepath.Join(configDir, fileName) // Check if the file already exists; if it does not, create it _, err = os.Stat(filePath) @@ -106,7 +106,7 @@ func LoadWtfConfigFile(filePath string) *config.Config { // chmodConfigFile sets the mode of the config file to r+w for the owner only func chmodConfigFile() { configDir, _ := WtfConfigDir() - relPath := fmt.Sprintf("%s%s", configDir, WtfConfigFile) + relPath := filepath.Join(configDir, WtfConfigFile) absPath, _ := expandHomeDir(relPath) _, err := os.Stat(absPath) From f1b31f6f49cdcff940c5bac6de509f95b4fcd264 Mon Sep 17 00:00:00 2001 From: Chris Cummer Date: Sun, 4 Oct 2020 10:35:16 -0700 Subject: [PATCH 29/42] Update CHANGELOG.md --- CHANGELOG.md | 1 + 1 file changed, 1 insertion(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 030fec89..d5e8b639 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -11,6 +11,7 @@ * Exchange Rates module now displays rates in alphabetical order, sorted by the base rate, by [@senorprogrammer](https://github.com/senorprogrammer) * Feed Reader module no longer crashes on feeds that don't have a published date, [#958](https://github.com/wtfutil/wtf/issues/958) by [@cyingfan](https://github.com/cyingfan) * Stray blank lines no longer appear at the end of highlightable lists, [#977](https://github.com/wtfutil/wtf/pull/977) by [@cyingfan](https://github.com/cyingfan) +* `config.yml` now properly set to `0600` instead of `0666`, by [@cyingfan](https://github.com/cyingfan) ### 👍 Updated From b8168ce7f2e19b404ce451e04e45d005628d4adb Mon Sep 17 00:00:00 2001 From: "dependabot-preview[bot]" <27856297+dependabot-preview[bot]@users.noreply.github.com> Date: Tue, 6 Oct 2020 05:49:32 +0000 Subject: [PATCH 30/42] Bump github.com/digitalocean/godo from 1.44.0 to 1.46.0 Bumps [github.com/digitalocean/godo](https://github.com/digitalocean/godo) from 1.44.0 to 1.46.0. - [Release notes](https://github.com/digitalocean/godo/releases) - [Changelog](https://github.com/digitalocean/godo/blob/main/CHANGELOG.md) - [Commits](https://github.com/digitalocean/godo/compare/v1.44.0...v1.46.0) Signed-off-by: dependabot-preview[bot] --- go.mod | 2 +- go.sum | 2 ++ 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/go.mod b/go.mod index 2ff4943d..9c2adb44 100644 --- a/go.mod +++ b/go.mod @@ -15,7 +15,7 @@ require ( github.com/briandowns/openweathermap v0.0.0-20180804155945-5f41b7c9d92d github.com/cenkalti/backoff v2.2.1+incompatible // indirect github.com/chzyer/readline v0.0.0-20180603132655-2972be24d48e - github.com/digitalocean/godo v1.44.0 + github.com/digitalocean/godo v1.46.0 github.com/docker/distribution v2.7.1+incompatible // indirect github.com/docker/docker v1.13.1 github.com/docker/docker-credential-helpers v0.6.3 diff --git a/go.sum b/go.sum index 5f1f9853..8d74f33c 100644 --- a/go.sum +++ b/go.sum @@ -174,6 +174,8 @@ github.com/dgrijalva/jwt-go v3.2.0+incompatible/go.mod h1:E3ru+11k8xSBh+hMPgOLZm github.com/dgryski/go-sip13 v0.0.0-20181026042036-e10d5fee7954/go.mod h1:vAd38F8PWV+bWy6jNmig1y/TA+kYO4g3RSRF0IAv0no= github.com/digitalocean/godo v1.44.0 h1:IMElzMUpO1dVR8qjSg53+5vDkOLzMbhJt4yTAq7NGCQ= github.com/digitalocean/godo v1.44.0/go.mod h1:p7dOjjtSBqCTUksqtA5Fd3uaKs9kyTq2xcz76ulEJRU= +github.com/digitalocean/godo v1.46.0 h1:WRbwjATilgz2NE4NGMeSDpeicy9h4xSKNGuRJ/Nq/fA= +github.com/digitalocean/godo v1.46.0/go.mod h1:p7dOjjtSBqCTUksqtA5Fd3uaKs9kyTq2xcz76ulEJRU= github.com/dlclark/regexp2 v1.2.0 h1:8sAhBGEM0dRWogWqWyQeIJnxjWO6oIjl8FKqREDsGfk= github.com/dlclark/regexp2 v1.2.0/go.mod h1:2pZnwuY/m+8K6iRw6wQdMtk+rH5tNGR1i55kozfMjCc= github.com/dnaeon/go-vcr v0.0.0-20180920040454-5637cf3d8a31 h1:Dzuw9GtbmllUqEcoHfScT9YpKFUssSiZ5PgZkIGf/YQ= From 798d812f80468316a8168126160c6007b363dfe0 Mon Sep 17 00:00:00 2001 From: Chris Cummer Date: Tue, 6 Oct 2020 19:38:38 -0700 Subject: [PATCH 31/42] Update CHANGELOG.md --- CHANGELOG.md | 1 + 1 file changed, 1 insertion(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index d5e8b639..d1500816 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -5,6 +5,7 @@ ### ⚡️ Added * FeedReader module supports [display mode switching](https://github.com/wtfutil/wtf/pull/976) via the `t` key, by [@cyingfan](https://github.com/cyingfan) +* Clocks module now supports `natural` ordering option, [#896](https://github.com/wtfutil/wtf/issues/896) by [@seanstoppable](https://github.com/Seanstoppable) ### 🐞 Fixed From 4192a0259416e4e4c616cc1bce826767646c45ac Mon Sep 17 00:00:00 2001 From: Todd Trimble Date: Tue, 6 Oct 2020 22:41:44 -0400 Subject: [PATCH 32/42] Add info table tests (#985) * Add info table tests * Fix lint error about initialization --- view/info_table_test.go | 44 +++++++++++++++++++++++++++++++++++++++++ 1 file changed, 44 insertions(+) create mode 100644 view/info_table_test.go diff --git a/view/info_table_test.go b/view/info_table_test.go new file mode 100644 index 00000000..eb008644 --- /dev/null +++ b/view/info_table_test.go @@ -0,0 +1,44 @@ +package view + +import ( + "testing" + + "github.com/stretchr/testify/assert" +) + +func makeMap() map[string]string { + m := make(map[string]string) + m["foo"] = "val1" + m["bar"] = "val2" + m["baz"] = "val3" + + return m +} + +func newTestTable(height int) *InfoTable { + var headers [2]string + + headers[0] = "hdr0" + headers[1] = "hdr1" + + table := NewInfoTable( + headers[:], + makeMap(), + 1, + 1, + height, + ) + return table +} + +func Test_RenderSimpleInfoTable(t *testing.T) { + table := newTestTable(4).Render() + + assert.Equal(t, " ----- ------ \n HDR0 HDR1 \n ----- ------ \n bar val2 \n baz val3 \n foo val1 \n ----- ------ \n", table) +} + +func Test_RenderPaddedInfoTable(t *testing.T) { + table := newTestTable(6).Render() + + assert.Equal(t, " ----- ------ \n HDR0 HDR1 \n ----- ------ \n bar val2 \n baz val3 \n foo val1 \n \n \n ----- ------ \n", table) +} From 264b9875ea3892706204c9801de030d5d80a51d0 Mon Sep 17 00:00:00 2001 From: Chris Cummer Date: Tue, 6 Oct 2020 19:42:04 -0700 Subject: [PATCH 33/42] Add @trimble as a contributor --- .all-contributorsrc | 10 ++++++++-- README.md | 1 + 2 files changed, 9 insertions(+), 2 deletions(-) diff --git a/.all-contributorsrc b/.all-contributorsrc index e065e25a..978a3010 100644 --- a/.all-contributorsrc +++ b/.all-contributorsrc @@ -973,14 +973,20 @@ "name": "Martin Johns", "avatar_url": "https://avatars1.githubusercontent.com/u/5269069?v=4", "profile": "https://github.com/MartinJohns", - "contributions": [ - ] + "contributions": [] }, { "login": "jamietanna", "name": "Jamie Tanna", "avatar_url": "https://avatars0.githubusercontent.com/u/3315059?v=4", "profile": "https://www.jvt.me", + "contributions": [] + }, + { + "login": "trimble", + "name": "Todd Trimble", + "avatar_url": "https://avatars3.githubusercontent.com/u/371317?v=4", + "profile": "https://github.com/trimble", "contributions": [ ] } diff --git a/README.md b/README.md index 42f417f0..f70e7fe1 100644 --- a/README.md +++ b/README.md @@ -403,6 +403,7 @@ Dependency management in WTF is handled by [Go modules](https://github.com/golan
Ying Fan Chong


Martin Johns


Jamie Tanna

+
Todd Trimble

From 0f07cb698073b00de6cdcf19a91409ea97902ddf Mon Sep 17 00:00:00 2001 From: Chris Cummer Date: Tue, 6 Oct 2020 19:46:24 -0700 Subject: [PATCH 34/42] Add @mhanberg as a contributor --- .all-contributorsrc | 7 +++++++ README.md | 3 +++ 2 files changed, 10 insertions(+) diff --git a/.all-contributorsrc b/.all-contributorsrc index 978a3010..a8aedc1e 100644 --- a/.all-contributorsrc +++ b/.all-contributorsrc @@ -987,6 +987,13 @@ "name": "Todd Trimble", "avatar_url": "https://avatars3.githubusercontent.com/u/371317?v=4", "profile": "https://github.com/trimble", + "contributions": [] + }, + { + "login": "mhanberg", + "name": "Mitchell Hanberg", + "avatar_url": "https://avatars2.githubusercontent.com/u/5523984?v=4", + "profile": "https://www.mitchellhanberg.com", "contributions": [ ] } diff --git a/README.md b/README.md index f70e7fe1..eb2c1b16 100644 --- a/README.md +++ b/README.md @@ -405,6 +405,9 @@ Dependency management in WTF is handled by [Go modules](https://github.com/golan
Jamie Tanna


Todd Trimble

+ +
Mitchell Hanberg

+ From f7d99c5effd102baa97b5905b10ee97f8964c4d9 Mon Sep 17 00:00:00 2001 From: Chris Cummer Date: Tue, 6 Oct 2020 20:00:47 -0700 Subject: [PATCH 35/42] Don't trim whitespace from beginning of widget Some widgets format the output using whitespace padding at the beginning. Signed-off-by: Chris Cummer --- modules/clocks/display.go | 6 ++---- view/text_widget.go | 4 +++- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/modules/clocks/display.go b/modules/clocks/display.go index 7c1a5bca..ffa986f9 100644 --- a/modules/clocks/display.go +++ b/modules/clocks/display.go @@ -1,15 +1,13 @@ package clocks -import ( - "fmt" -) +import "fmt" func (widget *Widget) display(clocks []Clock, dateFormat string, timeFormat string) { str := "" + if len(clocks) == 0 { str = fmt.Sprintf("\n%s", " no timezone data available") } else { - for idx, clock := range clocks { str += fmt.Sprintf( " [%s]%-12s %-10s %7s[white]\n", diff --git a/view/text_widget.go b/view/text_widget.go index 09f92df4..f143effb 100644 --- a/view/text_widget.go +++ b/view/text_widget.go @@ -38,7 +38,9 @@ func (widget *TextWidget) Redraw(data func() (string, string, bool)) { widget.View.Clear() widget.View.SetWrap(wrap) widget.View.SetTitle(widget.ContextualTitle(title)) - widget.View.SetText(strings.TrimSpace(content)) + // widget.View.SetText(strings.TrimSpace(content)) + widget.View.SetText(strings.TrimRight(content, "\n")) + // widget.View.SetText(content) }) } From 87ce0d887ee2249e550b3adaf9c06c17691c7687 Mon Sep 17 00:00:00 2001 From: Chris Cummer Date: Tue, 6 Oct 2020 20:05:19 -0700 Subject: [PATCH 36/42] Pretty format the GitHub stats Signed-off-by: Chris Cummer --- modules/github/display.go | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/modules/github/display.go b/modules/github/display.go index c633d21d..bd86922e 100644 --- a/modules/github/display.go +++ b/modules/github/display.go @@ -4,6 +4,8 @@ import ( "fmt" "github.com/google/go-github/v26/github" + "golang.org/x/text/language" + "golang.org/x/text/message" ) func (widget *Widget) display() { @@ -122,11 +124,13 @@ func (widget *Widget) displayMyReviewRequests(repo *GithubRepo, username string) } func (widget *Widget) displayStats(repo *GithubRepo) string { + prntr := message.NewPrinter(language.English) + str := fmt.Sprintf( - " PRs: %d Issues: %d Stars: %d\n", - repo.PullRequestCount(), - repo.IssueCount(), - repo.StarCount(), + " PRs: %s Issues: %s Stars: %s\n", + prntr.Sprintf("%d", repo.PullRequestCount()), + prntr.Sprintf("%d", repo.IssueCount()), + prntr.Sprintf("%d", repo.StarCount()), ) return str From 38e21605a4efc52e1afc72d94bf491aeef009bc1 Mon Sep 17 00:00:00 2001 From: Todd Trimble Date: Wed, 7 Oct 2020 17:56:20 -0400 Subject: [PATCH 37/42] Add tests for specified min column width (#990) --- view/info_table_test.go | 28 +++++++++++++++++++++++----- 1 file changed, 23 insertions(+), 5 deletions(-) diff --git a/view/info_table_test.go b/view/info_table_test.go index eb008644..5268627f 100644 --- a/view/info_table_test.go +++ b/view/info_table_test.go @@ -15,7 +15,7 @@ func makeMap() map[string]string { return m } -func newTestTable(height int) *InfoTable { +func newTestTable(height, colWidth0, colWidth1 int) *InfoTable { var headers [2]string headers[0] = "hdr0" @@ -24,21 +24,39 @@ func newTestTable(height int) *InfoTable { table := NewInfoTable( headers[:], makeMap(), - 1, - 1, + colWidth0, + colWidth1, height, ) return table } func Test_RenderSimpleInfoTable(t *testing.T) { - table := newTestTable(4).Render() + table := newTestTable(4, 1, 1).Render() assert.Equal(t, " ----- ------ \n HDR0 HDR1 \n ----- ------ \n bar val2 \n baz val3 \n foo val1 \n ----- ------ \n", table) } func Test_RenderPaddedInfoTable(t *testing.T) { - table := newTestTable(6).Render() + table := newTestTable(6, 1, 1).Render() assert.Equal(t, " ----- ------ \n HDR0 HDR1 \n ----- ------ \n bar val2 \n baz val3 \n foo val1 \n \n \n ----- ------ \n", table) } + +func Test_RenderWithSpecifiedWidthLeftColumn(t *testing.T) { + table := newTestTable(4, 10, 1).Render() + + assert.Equal(t, " ------------ ------ \n HDR0 HDR1 \n ------------ ------ \n bar val2 \n baz val3 \n foo val1 \n ------------ ------ \n", table) +} + +func Test_RenderWithSpecifiedWidthRightColumn(t *testing.T) { + table := newTestTable(4, 1, 10).Render() + + assert.Equal(t, " ----- ------------ \n HDR0 HDR1 \n ----- ------------ \n bar val2 \n baz val3 \n foo val1 \n ----- ------------ \n", table) +} + +func Test_RenderWithSpecifiedWidthBothColumns(t *testing.T) { + table := newTestTable(4, 15, 10).Render() + + assert.Equal(t, " ----------------- ------------ \n HDR0 HDR1 \n ----------------- ------------ \n bar val2 \n baz val3 \n foo val1 \n ----------------- ------------ \n", table) +} From 3c63eee8d3f0f81b41b96e85da0542ca6b0c5cec Mon Sep 17 00:00:00 2001 From: Sean Smith Date: Wed, 7 Oct 2020 17:58:24 -0400 Subject: [PATCH 38/42] Create generalized todo module (#982) * Create generalized todo module Makes existing modules "backends" This gives us a consistent interface * Fix check issues * Fix lint errors * Make changes to stay on wtfutil todoist fork --- app/widget_maker.go | 14 +- modules/todo_plus/backend/backend.go | 16 ++ modules/todo_plus/backend/project.go | 66 ++++++++ modules/todo_plus/backend/todoist.go | 108 +++++++++++++ modules/todo_plus/backend/trello.go | 170 +++++++++++++++++++++ modules/{todoist => todo_plus}/display.go | 15 +- modules/{todoist => todo_plus}/keyboard.go | 8 +- modules/todo_plus/settings.go | 81 ++++++++++ modules/{todoist => todo_plus}/widget.go | 101 ++++++------ modules/todoist/project.go | 93 ----------- modules/todoist/settings.go | 36 ----- modules/trello/card.go | 13 -- modules/trello/client.go | 106 ------------- modules/trello/search_result.go | 6 - modules/trello/settings.go | 62 -------- modules/trello/widget.go | 75 --------- 16 files changed, 511 insertions(+), 459 deletions(-) create mode 100644 modules/todo_plus/backend/backend.go create mode 100644 modules/todo_plus/backend/project.go create mode 100644 modules/todo_plus/backend/todoist.go create mode 100644 modules/todo_plus/backend/trello.go rename modules/{todoist => todo_plus}/display.go (75%) rename modules/{todoist => todo_plus}/keyboard.go (98%) create mode 100644 modules/todo_plus/settings.go rename modules/{todoist => todo_plus}/widget.go (53%) delete mode 100644 modules/todoist/project.go delete mode 100644 modules/todoist/settings.go delete mode 100644 modules/trello/card.go delete mode 100644 modules/trello/client.go delete mode 100644 modules/trello/search_result.go delete mode 100644 modules/trello/settings.go delete mode 100644 modules/trello/widget.go diff --git a/app/widget_maker.go b/app/widget_maker.go index 9b9d9766..6f7275a8 100644 --- a/app/widget_maker.go +++ b/app/widget_maker.go @@ -59,10 +59,9 @@ import ( "github.com/wtfutil/wtf/modules/subreddit" "github.com/wtfutil/wtf/modules/textfile" "github.com/wtfutil/wtf/modules/todo" - "github.com/wtfutil/wtf/modules/todoist" + "github.com/wtfutil/wtf/modules/todo_plus" "github.com/wtfutil/wtf/modules/transmission" "github.com/wtfutil/wtf/modules/travisci" - "github.com/wtfutil/wtf/modules/trello" "github.com/wtfutil/wtf/modules/twitch" "github.com/wtfutil/wtf/modules/twitter" "github.com/wtfutil/wtf/modules/twitterstats" @@ -269,9 +268,12 @@ func MakeWidget( case "todo": settings := todo.NewSettingsFromYAML(moduleName, moduleConfig, config) widget = todo.NewWidget(app, pages, settings) + case "todo_plus": + settings := todo_plus.NewSettingsFromYAML(moduleName, moduleConfig, config) + widget = todo_plus.NewWidget(app, pages, settings) case "todoist": - settings := todoist.NewSettingsFromYAML(moduleName, moduleConfig, config) - widget = todoist.NewWidget(app, pages, settings) + settings := todo_plus.FromTodoist(moduleName, moduleConfig, config) + widget = todo_plus.NewWidget(app, pages, settings) case "transmission": settings := transmission.NewSettingsFromYAML(moduleName, moduleConfig, config) widget = transmission.NewWidget(app, pages, settings) @@ -279,8 +281,8 @@ func MakeWidget( settings := travisci.NewSettingsFromYAML(moduleName, moduleConfig, config) widget = travisci.NewWidget(app, pages, settings) case "trello": - settings := trello.NewSettingsFromYAML(moduleName, moduleConfig, config) - widget = trello.NewWidget(app, settings) + settings := todo_plus.FromTrello(moduleName, moduleConfig, config) + widget = todo_plus.NewWidget(app, pages, settings) case "twitch": settings := twitch.NewSettingsFromYAML(moduleName, moduleConfig, config) widget = twitch.NewWidget(app, pages, settings) diff --git a/modules/todo_plus/backend/backend.go b/modules/todo_plus/backend/backend.go new file mode 100644 index 00000000..7f116a54 --- /dev/null +++ b/modules/todo_plus/backend/backend.go @@ -0,0 +1,16 @@ +package backend + +import ( + "github.com/olebedev/config" +) + +type Backend interface { + Title() string + Setup(*config.Config) + BuildProjects() []*Project + GetProject(string) *Project + LoadTasks(string) ([]Task, error) + CloseTask(*Task) error + DeleteTask(*Task) error + Sources() []string +} diff --git a/modules/todo_plus/backend/project.go b/modules/todo_plus/backend/project.go new file mode 100644 index 00000000..8280900c --- /dev/null +++ b/modules/todo_plus/backend/project.go @@ -0,0 +1,66 @@ +package backend + +type Task struct { + ID string + Completed bool + Name string +} + +type Project struct { + ID string + Name string + + Index int + Tasks []Task + Err error + backend Backend +} + +func (proj *Project) IsLast() bool { + return proj.Index >= len(proj.Tasks)-1 +} + +func (proj *Project) loadTasks() { + Tasks, err := proj.backend.LoadTasks(proj.ID) + proj.Err = err + proj.Tasks = Tasks +} + +func (proj *Project) LongestLine() int { + maxLen := 0 + + for _, task := range proj.Tasks { + if len(task.Name) > maxLen { + maxLen = len(task.Name) + } + } + + return maxLen +} + +func (proj *Project) currentTask() *Task { + if proj.Index < 0 { + return nil + } + + return &proj.Tasks[proj.Index] +} + +func (proj *Project) CloseSelectedTask() { + currTask := proj.currentTask() + + if currTask != nil { + _ = proj.backend.CloseTask(currTask) + proj.loadTasks() + } +} + +func (proj *Project) DeleteSelectedTask() { + currTask := proj.currentTask() + + if currTask != nil { + _ = proj.backend.DeleteTask(currTask) + + proj.loadTasks() + } +} diff --git a/modules/todo_plus/backend/todoist.go b/modules/todo_plus/backend/todoist.go new file mode 100644 index 00000000..a49b1f4f --- /dev/null +++ b/modules/todo_plus/backend/todoist.go @@ -0,0 +1,108 @@ +package backend + +import ( + "strconv" + + "github.com/olebedev/config" + "github.com/wtfutil/todoist" +) + +type Todoist struct { + projects []interface{} +} + +func (todo *Todoist) Title() string { + return "Todoist" +} + +func (todo *Todoist) Setup(config *config.Config) { + todoist.Token = config.UString("apiKey") + todo.projects = config.UList("projects") +} + +func (todo *Todoist) BuildProjects() []*Project { + projects := []*Project{} + + for _, id := range todo.projects { + i := strconv.Itoa(id.(int)) + proj := todo.GetProject(i) + projects = append(projects, proj) + } + return projects +} + +func (todo *Todoist) GetProject(id string) *Project { + // Todoist seems to experience a lot of network issues on their side + // If we can't connect, handle it with an empty project until we can + proj := &Project{ + Index: -1, + backend: todo, + } + i64, _ := strconv.ParseUint(id, 10, 32) + i := uint(i64) + project, err := todoist.GetProject(i) + if err != nil { + proj.Err = err + return proj + } + + proj.ID = strconv.FormatUint(uint64(project.ID), 10) + proj.Name = project.Name + + tasks, err := todo.LoadTasks(proj.ID) + proj.Err = err + proj.Tasks = tasks + + return proj +} + +func toTask(task todoist.Task) Task { + id := strconv.FormatUint(uint64(task.ID), 10) + return Task{ + ID: id, + Completed: task.Completed, + Name: task.Content, + } +} + +func (todo *Todoist) LoadTasks(id string) ([]Task, error) { + tasks, err := todoist.ListTask(todoist.QueryParam{"project_id": id}) + + if err != nil { + return nil, err + } + var finalTasks []Task + for _, item := range tasks { + finalTasks = append(finalTasks, toTask(item)) + } + return finalTasks, nil +} + +func (todo *Todoist) CloseTask(task *Task) error { + if task != nil { + i64, _ := strconv.ParseUint(task.ID, 10, 32) + i := uint(i64) + internal := todoist.Task{ID: i} + return internal.Close() + } + return nil +} + +func (todo *Todoist) DeleteTask(task *Task) error { + if task != nil { + i64, _ := strconv.ParseUint(task.ID, 10, 32) + i := uint(i64) + internal := todoist.Task{ID: i} + return internal.Delete() + } + return nil +} + +func (todo *Todoist) Sources() []string { + var result []string + for _, id := range todo.projects { + i := strconv.Itoa(id.(int)) + result = append(result, i) + } + return result +} diff --git a/modules/todo_plus/backend/trello.go b/modules/todo_plus/backend/trello.go new file mode 100644 index 00000000..2ace375a --- /dev/null +++ b/modules/todo_plus/backend/trello.go @@ -0,0 +1,170 @@ +package backend + +import ( + "fmt" + "log" + + "github.com/adlio/trello" + "github.com/olebedev/config" +) + +type Trello struct { + username string + boardName string + client *trello.Client + board string + projects []interface{} +} + +func (todo *Trello) Title() string { + return "Trello" +} + +func (todo *Trello) Setup(config *config.Config) { + todo.username = config.UString("username") + todo.boardName = config.UString("board") + todo.client = trello.NewClient( + config.UString("apiKey"), + config.UString("accessToken"), + ) + board, err := getBoardID(todo.client, todo.username, todo.boardName) + if err != nil { + log.Fatal(err) + } + todo.board = board + todo.projects = config.UList("lists") +} + +func getBoardID(client *trello.Client, username, boardName string) (string, error) { + member, err := client.GetMember(username, trello.Defaults()) + if err != nil { + return "", err + } + + boards, err := member.GetBoards(trello.Defaults()) + if err != nil { + return "", err + } + + for _, board := range boards { + if board.Name == boardName { + return board.ID, nil + } + } + + return "", fmt.Errorf("could not find board with name %s", boardName) +} + +func getListId(client *trello.Client, boardID string, listName string) (string, error) { + board, err := client.GetBoard(boardID, trello.Defaults()) + if err != nil { + return "", err + } + + boardLists, err := board.GetLists(trello.Defaults()) + if err != nil { + return "", err + } + + for _, list := range boardLists { + if list.Name == listName { + return list.ID, nil + } + } + + return "", nil +} + +func getCardsOnList(client *trello.Client, listID string) ([]*trello.Card, error) { + list, err := client.GetList(listID, trello.Defaults()) + if err != nil { + return nil, err + } + + cards, err := list.GetCards(trello.Defaults()) + if err != nil { + return nil, err + } + + return cards, nil +} + +func (todo *Trello) BuildProjects() []*Project { + projects := []*Project{} + + for _, id := range todo.projects { + proj := todo.GetProject(id.(string)) + projects = append(projects, proj) + } + return projects +} + +func (todo *Trello) GetProject(id string) *Project { + proj := &Project{ + Index: -1, + backend: todo, + } + + listId, err := getListId(todo.client, todo.board, id) + if err != nil { + proj.Err = err + return proj + } + proj.ID = listId + proj.Name = id + + tasks, err := todo.LoadTasks(listId) + proj.Err = err + proj.Tasks = tasks + + return proj +} + +func fromTrello(task *trello.Card) Task { + return Task{ + ID: task.ID, + Completed: task.Closed, + Name: task.Name, + } +} + +func (todo *Trello) LoadTasks(id string) ([]Task, error) { + tasks, err := getCardsOnList(todo.client, id) + + if err != nil { + return nil, err + } + var finalTasks []Task + for _, item := range tasks { + finalTasks = append(finalTasks, fromTrello(item)) + } + return finalTasks, nil +} + +func (todo *Trello) CloseTask(task *Task) error { + args := trello.Arguments{ + "closed": "true", + } + if task != nil { + // Card has an internal client rep which we can't access + // Just force a lookup + internal, err := todo.client.GetCard(task.ID, trello.Arguments{}) + if err != nil { + return err + } + return internal.Update(args) + } + return nil +} + +func (todo *Trello) DeleteTask(task *Task) error { + return nil +} + +func (todo *Trello) Sources() []string { + var result []string + for _, id := range todo.projects { + result = append(result, id.(string)) + } + return result +} diff --git a/modules/todoist/display.go b/modules/todo_plus/display.go similarity index 75% rename from modules/todoist/display.go rename to modules/todo_plus/display.go index 49caa56d..9ca1f86a 100644 --- a/modules/todoist/display.go +++ b/modules/todo_plus/display.go @@ -1,4 +1,4 @@ -package todoist +package todo_plus import ( "fmt" @@ -14,27 +14,26 @@ func (widget *Widget) content() (string, string, bool) { return widget.CommonSettings().Title, "", false } - if proj.err != nil { - return widget.CommonSettings().Title, proj.err.Error(), true + if proj.Err != nil { + return widget.CommonSettings().Title, proj.Err.Error(), true } title := fmt.Sprintf( "[%s]%s[white]", widget.settings.common.Colors.TextTheme.Title, - proj.Project.Name, - ) + proj.Name) str := "" - for idx, item := range proj.tasks { + for idx, item := range proj.Tasks { row := fmt.Sprintf( `[%s]| | %s[%s]`, widget.RowColor(idx), - tview.Escape(item.Content), + tview.Escape(item.Name), widget.RowColor(idx), ) - str += utils.HighlightableHelper(widget.View, row, idx, len(item.Content)) + str += utils.HighlightableHelper(widget.View, row, idx, len(item.Name)) } return title, str, false } diff --git a/modules/todoist/keyboard.go b/modules/todo_plus/keyboard.go similarity index 98% rename from modules/todoist/keyboard.go rename to modules/todo_plus/keyboard.go index 05ccd93b..282b2a28 100644 --- a/modules/todoist/keyboard.go +++ b/modules/todo_plus/keyboard.go @@ -1,21 +1,21 @@ -package todoist +package todo_plus import "github.com/gdamore/tcell" func (widget *Widget) initializeKeyboardControls() { widget.InitializeCommonControls(widget.Refresh) - widget.SetKeyboardChar("c", widget.Close, "Close item") widget.SetKeyboardChar("d", widget.Delete, "Delete item") - widget.SetKeyboardChar("h", widget.PrevSource, "Select previous project") widget.SetKeyboardChar("j", widget.Prev, "Select previous item") widget.SetKeyboardChar("k", widget.Next, "Select next item") + widget.SetKeyboardChar("h", widget.PrevSource, "Select previous project") + widget.SetKeyboardChar("c", widget.Close, "Close item") widget.SetKeyboardChar("l", widget.NextSource, "Select next project") widget.SetKeyboardChar("u", widget.Unselect, "Clear selection") widget.SetKeyboardKey(tcell.KeyDown, widget.Next, "Select next item") + widget.SetKeyboardKey(tcell.KeyUp, widget.Prev, "Select previous item") widget.SetKeyboardKey(tcell.KeyEsc, widget.Unselect, "Clear selection") widget.SetKeyboardKey(tcell.KeyLeft, widget.PrevSource, "Select previous project") widget.SetKeyboardKey(tcell.KeyRight, widget.NextSource, "Select next project") - widget.SetKeyboardKey(tcell.KeyUp, widget.Prev, "Select previous item") } diff --git a/modules/todo_plus/settings.go b/modules/todo_plus/settings.go new file mode 100644 index 00000000..686e8a63 --- /dev/null +++ b/modules/todo_plus/settings.go @@ -0,0 +1,81 @@ +package todo_plus + +import ( + "os" + + "github.com/olebedev/config" + "github.com/wtfutil/wtf/cfg" +) + +const ( + defaultTitle = "Todo" + defaultFocusable = true +) + +type Settings struct { + common *cfg.Common + + backendType string + backendSettings *config.Config +} + +func NewSettingsFromYAML(name string, ymlConfig *config.Config, globalConfig *config.Config) *Settings { + + backend, _ := ymlConfig.Get("backendSettings") + + settings := Settings{ + common: cfg.NewCommonSettingsFromModule(name, defaultTitle, defaultFocusable, ymlConfig, globalConfig), + + backendType: ymlConfig.UString("backendType"), + backendSettings: backend, + } + + return &settings +} + +func FromTodoist(name string, ymlConfig *config.Config, globalConfig *config.Config) *Settings { + apiKey := ymlConfig.UString("apiKey", ymlConfig.UString("apikey", os.Getenv("WTF_TODOIST_TOKEN"))) + cfg.ModuleSecret(name, globalConfig, &apiKey).Load() + projects := ymlConfig.UList("projects") + backend, _ := config.ParseYaml("apiKey: " + apiKey) + _ = backend.Set(".projects", projects) + + settings := Settings{ + common: cfg.NewCommonSettingsFromModule(name, defaultTitle, defaultFocusable, ymlConfig, globalConfig), + + backendType: "todoist", + backendSettings: backend, + } + + return &settings +} + +func FromTrello(name string, ymlConfig *config.Config, globalConfig *config.Config) *Settings { + + accessToken := ymlConfig.UString("accessToken", ymlConfig.UString("apikey", os.Getenv("WTF_TRELLO_ACCESS_TOKEN"))) + apiKey := ymlConfig.UString("apiKey", os.Getenv("WTF_TRELLO_API_KEY")) + cfg.ModuleSecret(name, globalConfig, &apiKey).Load() + board := ymlConfig.UString("board") + username := ymlConfig.UString("username") + var lists []interface{} + list, err := ymlConfig.String("list") + if err == nil { + lists = append(lists, list) + } else { + lists = ymlConfig.UList("list") + } + backend, _ := config.ParseYaml("apiKey: " + apiKey) + _ = backend.Set(".accessToken", accessToken) + _ = backend.Set(".board", board) + _ = backend.Set(".username", username) + _ = backend.Set(".lists", lists) + + settings := Settings{ + common: cfg.NewCommonSettingsFromModule(name, defaultTitle, defaultFocusable, ymlConfig, globalConfig), + + backendType: "trello", + backendSettings: backend, + } + + return &settings +} diff --git a/modules/todoist/widget.go b/modules/todo_plus/widget.go similarity index 53% rename from modules/todoist/widget.go rename to modules/todo_plus/widget.go index afa920cc..5a23b5b1 100644 --- a/modules/todoist/widget.go +++ b/modules/todo_plus/widget.go @@ -1,8 +1,10 @@ -package todoist +package todo_plus import ( + "log" + "github.com/rivo/tview" - "github.com/wtfutil/todoist" + "github.com/wtfutil/wtf/modules/todo_plus/backend" "github.com/wtfutil/wtf/view" ) @@ -12,8 +14,9 @@ type Widget struct { view.MultiSourceWidget view.ScrollableWidget - projects []*Project + projects []*backend.Project settings *Settings + backend backend.Backend } // NewWidget creates a new instance of a widget @@ -26,8 +29,9 @@ func NewWidget(app *tview.Application, pages *tview.Pages, settings *Settings) * settings: settings, } - widget.loadAPICredentials() - widget.loadProjects() + widget.backend = getBackend(settings.backendType) + widget.backend.Setup(settings.backendSettings) + widget.CommonSettings().Title = widget.backend.Title() widget.SetRenderFunction(widget.display) widget.initializeKeyboardControls() @@ -39,13 +43,28 @@ func NewWidget(app *tview.Application, pages *tview.Pages, settings *Settings) * return &widget } +func getBackend(backendType string) backend.Backend { + switch backendType { + case "trello": + backend := &backend.Trello{} + return backend + case "todoist": + backend := &backend.Todoist{} + return backend + default: + log.Fatal(backendType + " is not a supported backend") + return nil + } + +} + /* -------------------- Exported Functions -------------------- */ -func (widget *Widget) CurrentProject() *Project { +func (widget *Widget) CurrentProject() *backend.Project { return widget.ProjectAt(widget.Idx) } -func (widget *Widget) ProjectAt(idx int) *Project { +func (widget *Widget) ProjectAt(idx int) *backend.Project { if len(widget.projects) == 0 { return nil } @@ -54,14 +73,13 @@ func (widget *Widget) ProjectAt(idx int) *Project { } func (widget *Widget) Refresh() { - if widget.Disabled() || widget.CurrentProject() == nil { - widget.SetItemCount(0) + if widget.Disabled() { return } - widget.loadProjects() - - widget.SetItemCount(len(widget.CurrentProject().tasks)) + widget.projects = widget.backend.BuildProjects() + widget.Sources = widget.backend.Sources() + widget.SetItemCount(len(widget.CurrentProject().Tasks)) widget.display() } @@ -71,74 +89,57 @@ func (widget *Widget) HelpText() string { func (widget *Widget) NextSource() { widget.MultiSourceWidget.NextSource() - widget.Selected = widget.CurrentProject().index - widget.SetItemCount(len(widget.CurrentProject().tasks)) + widget.Selected = widget.CurrentProject().Index + widget.SetItemCount(len(widget.CurrentProject().Tasks)) widget.RenderFunction() } func (widget *Widget) PrevSource() { widget.MultiSourceWidget.PrevSource() - widget.Selected = widget.CurrentProject().index - widget.SetItemCount(len(widget.CurrentProject().tasks)) + widget.Selected = widget.CurrentProject().Index + widget.SetItemCount(len(widget.CurrentProject().Tasks)) widget.RenderFunction() } func (widget *Widget) Prev() { widget.ScrollableWidget.Prev() - widget.CurrentProject().index = widget.Selected + widget.CurrentProject().Index = widget.Selected } func (widget *Widget) Next() { widget.ScrollableWidget.Next() - widget.CurrentProject().index = widget.Selected + widget.CurrentProject().Index = widget.Selected } func (widget *Widget) Unselect() { widget.ScrollableWidget.Unselect() - widget.CurrentProject().index = -1 + widget.CurrentProject().Index = -1 widget.RenderFunction() } /* -------------------- Keyboard Movement -------------------- */ // Close closes the currently-selected task in the currently-selected project -func (widget *Widget) Close() { - widget.CurrentProject().closeSelectedTask() - widget.SetItemCount(len(widget.CurrentProject().tasks)) +func (w *Widget) Close() { + w.CurrentProject().CloseSelectedTask() + w.SetItemCount(len(w.CurrentProject().Tasks)) - if widget.CurrentProject().isLast() { - widget.Prev() + if w.CurrentProject().IsLast() { + w.Prev() return } - widget.CurrentProject().index = widget.Selected - widget.RenderFunction() + w.CurrentProject().Index = w.Selected + w.RenderFunction() } // Delete deletes the currently-selected task in the currently-selected project -func (widget *Widget) Delete() { - widget.CurrentProject().deleteSelectedTask() - widget.SetItemCount(len(widget.CurrentProject().tasks)) +func (w *Widget) Delete() { + w.CurrentProject().DeleteSelectedTask() + w.SetItemCount(len(w.CurrentProject().Tasks)) - if widget.CurrentProject().isLast() { - widget.Prev() + if w.CurrentProject().IsLast() { + w.Prev() } - widget.CurrentProject().index = widget.Selected - widget.RenderFunction() -} - -/* -------------------- Unexported Functions -------------------- */ - -func (widget *Widget) loadAPICredentials() { - todoist.Token = widget.settings.apiKey -} - -func (widget *Widget) loadProjects() { - projects := []*Project{} - - for _, id := range widget.settings.projects { - proj := NewProject(id) - projects = append(projects, proj) - } - - widget.projects = projects + w.CurrentProject().Index = w.Selected + w.RenderFunction() } diff --git a/modules/todoist/project.go b/modules/todoist/project.go deleted file mode 100644 index ae2919c4..00000000 --- a/modules/todoist/project.go +++ /dev/null @@ -1,93 +0,0 @@ -package todoist - -import ( - "fmt" - - "github.com/wtfutil/todoist" -) - -type Project struct { - todoist.Project - - index int - tasks []todoist.Task - err error -} - -func NewProject(id uint) *Project { - // Todoist seems to experience a lot of network issues on their side - // If we can't connect, handle it with an empty project until we can - project, err := todoist.GetProject(id) - proj := &Project{ - index: -1, - } - if err != nil { - proj.err = err - return proj - } - - proj.Project = project - - proj.loadTasks() - - return proj -} - -func (proj *Project) isLast() bool { - return proj.index >= len(proj.tasks)-1 -} - -func (proj *Project) loadTasks() { - tasks, err := todoist.ListTask(todoist.QueryParam{"project_id": fmt.Sprintf("%d", proj.ID)}) - if err != nil { - proj.err = err - proj.tasks = nil - } else { - proj.err = nil - proj.tasks = tasks - } -} - -func (proj *Project) LongestLine() int { - maxLen := 0 - - for _, task := range proj.tasks { - if len(task.Content) > maxLen { - maxLen = len(task.Content) - } - } - - return maxLen -} - -func (proj *Project) currentTask() *todoist.Task { - if proj.index < 0 { - return nil - } - - return &proj.tasks[proj.index] -} - -func (proj *Project) closeSelectedTask() { - currTask := proj.currentTask() - - if currTask != nil { - if err := currTask.Close(); err != nil { - return - } - - proj.loadTasks() - } -} - -func (proj *Project) deleteSelectedTask() { - currTask := proj.currentTask() - - if currTask != nil { - if err := currTask.Delete(); err != nil { - return - } - - proj.loadTasks() - } -} diff --git a/modules/todoist/settings.go b/modules/todoist/settings.go deleted file mode 100644 index 3dc100dc..00000000 --- a/modules/todoist/settings.go +++ /dev/null @@ -1,36 +0,0 @@ -package todoist - -import ( - "os" - - "github.com/olebedev/config" - "github.com/wtfutil/wtf/cfg" - "github.com/wtfutil/wtf/utils" -) - -const ( - defaultFocusable = true - defaultTitle = "Todoist" -) - -// Settings defines the configuration properties for this module -type Settings struct { - common *cfg.Common - - apiKey string `help:"Your Todoist API key"` - projects []uint -} - -// NewSettingsFromYAML creates a new settings instance from a YAML config block -func NewSettingsFromYAML(name string, ymlConfig *config.Config, globalConfig *config.Config) *Settings { - settings := Settings{ - common: cfg.NewCommonSettingsFromModule(name, defaultTitle, defaultFocusable, ymlConfig, globalConfig), - - apiKey: ymlConfig.UString("apiKey", ymlConfig.UString("apikey", os.Getenv("WTF_TODOIST_TOKEN"))), - projects: utils.IntsToUints(utils.ToInts(ymlConfig.UList("projects"))), - } - - cfg.ModuleSecret(name, globalConfig, &settings.apiKey).Load() - - return &settings -} diff --git a/modules/trello/card.go b/modules/trello/card.go deleted file mode 100644 index 31f3467c..00000000 --- a/modules/trello/card.go +++ /dev/null @@ -1,13 +0,0 @@ -package trello - -type TrelloCard struct { - ID string - Name string - List string - Description string -} - -type TrelloList struct { - ID string - Name string -} diff --git a/modules/trello/client.go b/modules/trello/client.go deleted file mode 100644 index 6df6cc22..00000000 --- a/modules/trello/client.go +++ /dev/null @@ -1,106 +0,0 @@ -package trello - -import ( - "fmt" - - "github.com/adlio/trello" -) - -func GetCards(client *trello.Client, username string, boardName string, listNames []string) (*SearchResult, error) { - boardID, err := getBoardID(client, username, boardName) - if err != nil { - return nil, err - } - - lists, err := getLists(client, boardID, listNames) - if err != nil { - return nil, err - } - - searchResult := &SearchResult{Total: 0} - searchResult.TrelloCards = make(map[string][]TrelloCard) - - for _, list := range lists { - cards, err := getCardsOnList(client, list.ID) - if err != nil { - return nil, err - } - - searchResult.Total += len(cards) - cardArray := make([]TrelloCard, 0) - - for _, card := range cards { - trelloCard := TrelloCard{ - ID: card.ID, - List: list.Name, - Name: card.Name, - Description: card.Desc, - } - cardArray = append(cardArray, trelloCard) - } - - searchResult.TrelloCards[list.Name] = cardArray - } - - return searchResult, nil -} - -func getBoardID(client *trello.Client, username, boardName string) (string, error) { - member, err := client.GetMember(username, trello.Defaults()) - if err != nil { - return "", err - } - - boards, err := member.GetBoards(trello.Defaults()) - if err != nil { - return "", err - } - - for _, board := range boards { - if board.Name == boardName { - return board.ID, nil - } - } - - return "", fmt.Errorf("could not find board with name %s", boardName) -} - -func getLists(client *trello.Client, boardID string, listNames []string) ([]TrelloList, error) { - comparison := make(map[string]string, len(listNames)) - results := []TrelloList{} - //convert to a map for comparison - for _, item := range listNames { - comparison[item] = "" - } - board, err := client.GetBoard(boardID, trello.Defaults()) - if err != nil { - return nil, err - } - - boardLists, err := board.GetLists(trello.Defaults()) - if err != nil { - return nil, err - } - - for _, list := range boardLists { - if _, ok := comparison[list.Name]; ok { - results = append(results, TrelloList{ID: list.ID, Name: list.Name}) - } - } - - return results, nil -} - -func getCardsOnList(client *trello.Client, listID string) ([]*trello.Card, error) { - list, err := client.GetList(listID, trello.Defaults()) - if err != nil { - return nil, err - } - - cards, err := list.GetCards(trello.Defaults()) - if err != nil { - return nil, err - } - - return cards, nil -} diff --git a/modules/trello/search_result.go b/modules/trello/search_result.go deleted file mode 100644 index 44ca8dc7..00000000 --- a/modules/trello/search_result.go +++ /dev/null @@ -1,6 +0,0 @@ -package trello - -type SearchResult struct { - Total int - TrelloCards map[string][]TrelloCard -} diff --git a/modules/trello/settings.go b/modules/trello/settings.go deleted file mode 100644 index 341915b2..00000000 --- a/modules/trello/settings.go +++ /dev/null @@ -1,62 +0,0 @@ -package trello - -import ( - "os" - - "github.com/olebedev/config" - "github.com/wtfutil/wtf/cfg" -) - -const ( - defaultFocusable = false - defaultTitle = "Trello" -) - -type Settings struct { - common *cfg.Common - - accessToken string - apiKey string - board string - list []string - username string -} - -func NewSettingsFromYAML(name string, ymlConfig *config.Config, globalConfig *config.Config) *Settings { - settings := Settings{ - common: cfg.NewCommonSettingsFromModule(name, defaultTitle, defaultFocusable, ymlConfig, globalConfig), - - accessToken: ymlConfig.UString("accessToken", ymlConfig.UString("apikey", os.Getenv("WTF_TRELLO_ACCESS_TOKEN"))), - apiKey: ymlConfig.UString("apiKey", os.Getenv("WTF_TRELLO_API_KEY")), - board: ymlConfig.UString("board"), - username: ymlConfig.UString("username"), - } - - cfg.ModuleSecret(name+"-api", globalConfig, &settings.apiKey).Load() - cfg.ModuleSecret(name+"-access", globalConfig, &settings.accessToken).Load() - - settings.list = buildLists(ymlConfig, globalConfig) - - return &settings -} - -func buildLists(ymlConfig *config.Config, globalConfig *config.Config) []string { - lists := []string{} - - // Single list - list, err := ymlConfig.String("list") - if err == nil { - lists = append(lists, list) - return lists - } - - // Array of lists - listList := ymlConfig.UList("list") - for _, listName := range listList { - if list, ok := listName.(string); ok { - lists = append(lists, list) - } - } - - return lists -} diff --git a/modules/trello/widget.go b/modules/trello/widget.go deleted file mode 100644 index 01bb706d..00000000 --- a/modules/trello/widget.go +++ /dev/null @@ -1,75 +0,0 @@ -package trello - -import ( - "fmt" - - "github.com/adlio/trello" - "github.com/rivo/tview" - "github.com/wtfutil/wtf/view" -) - -type Widget struct { - view.TextWidget - - settings *Settings -} - -func NewWidget(app *tview.Application, settings *Settings) *Widget { - widget := Widget{ - TextWidget: view.NewTextWidget(app, settings.common), - - settings: settings, - } - - return &widget -} - -/* -------------------- Exported Functions -------------------- */ - -func (widget *Widget) Refresh() { - widget.Redraw(widget.content) -} - -/* -------------------- Unexported Functions -------------------- */ - -func (widget *Widget) content() (string, string, bool) { - - client := trello.NewClient( - widget.settings.apiKey, - widget.settings.accessToken, - ) - - // Get the cards - searchResult, err := GetCards( - client, - widget.settings.username, - widget.settings.board, - widget.settings.list, - ) - - var title string - content := "" - - wrap := false - if err != nil { - wrap = true - title = widget.CommonSettings().Title - content = err.Error() - } else { - title = fmt.Sprintf( - "[white]%s: [green]%s ", - widget.CommonSettings().Title, - widget.settings.board, - ) - for list, cardArray := range searchResult.TrelloCards { - content += fmt.Sprintf(" [%s]%s[white]\n", widget.settings.common.Colors.Subheading, list) - - for _, card := range cardArray { - content += fmt.Sprintf(" %s[white]\n", card.Name) - } - content = fmt.Sprintf("%s\n", content) - } - } - - return title, content, wrap -} From 450483791ff8d30135cf810b0e2b0999c0628028 Mon Sep 17 00:00:00 2001 From: Chris Cummer Date: Wed, 7 Oct 2020 16:06:57 -0700 Subject: [PATCH 39/42] Obey the linter; make the linter happy Signed-off-by: Chris Cummer --- modules/github/display.go | 10 ++++---- modules/github/github_repo.go | 44 +++++++++++++++++------------------ modules/github/widget.go | 8 +++---- 3 files changed, 31 insertions(+), 31 deletions(-) diff --git a/modules/github/display.go b/modules/github/display.go index bd86922e..e9145335 100644 --- a/modules/github/display.go +++ b/modules/github/display.go @@ -56,7 +56,7 @@ func (widget *Widget) content() (string, string, bool) { return title, str, false } -func (widget *Widget) displayMyPullRequests(repo *GithubRepo, username string) string { +func (widget *Widget) displayMyPullRequests(repo *Repo, username string) string { prs := repo.myPullRequests(username, widget.settings.enableStatus) prLength := len(prs) @@ -79,7 +79,7 @@ func (widget *Widget) displayMyPullRequests(repo *GithubRepo, username string) s return str } -func (widget *Widget) displayCustomQuery(repo *GithubRepo, filter string, perPage int) string { +func (widget *Widget) displayCustomQuery(repo *Repo, filter string, perPage int) string { res := repo.customIssueQuery(filter, perPage) if res == nil { @@ -106,7 +106,7 @@ func (widget *Widget) displayCustomQuery(repo *GithubRepo, filter string, perPag return str } -func (widget *Widget) displayMyReviewRequests(repo *GithubRepo, username string) string { +func (widget *Widget) displayMyReviewRequests(repo *Repo, username string) string { prs := repo.myReviewRequests(username) if len(prs) == 0 { @@ -123,7 +123,7 @@ func (widget *Widget) displayMyReviewRequests(repo *GithubRepo, username string) return str } -func (widget *Widget) displayStats(repo *GithubRepo) string { +func (widget *Widget) displayStats(repo *Repo) string { prntr := message.NewPrinter(language.English) str := fmt.Sprintf( @@ -136,7 +136,7 @@ func (widget *Widget) displayStats(repo *GithubRepo) string { return str } -func (widget *Widget) title(repo *GithubRepo) string { +func (widget *Widget) title(repo *Repo) string { return fmt.Sprintf( "[%s]%s - %s[white]", widget.settings.common.Colors.TextTheme.Title, diff --git a/modules/github/github_repo.go b/modules/github/github_repo.go index fb147f0a..1a22d5db 100644 --- a/modules/github/github_repo.go +++ b/modules/github/github_repo.go @@ -15,8 +15,8 @@ const ( issuesPath = "/issues" ) -// GithubRepo defines a new GithubRepo structure -type GithubRepo struct { +// Repo defines a new GitHub Repo structure +type Repo struct { apiKey string baseURL string uploadURL string @@ -29,8 +29,8 @@ type GithubRepo struct { } // NewGithubRepo returns a new Github Repo with a name, owner, apiKey, baseURL and uploadURL -func NewGithubRepo(name, owner, apiKey, baseURL, uploadURL string) *GithubRepo { - repo := GithubRepo{ +func NewGithubRepo(name, owner, apiKey, baseURL, uploadURL string) *Repo { + repo := Repo{ Name: name, Owner: owner, @@ -43,22 +43,22 @@ func NewGithubRepo(name, owner, apiKey, baseURL, uploadURL string) *GithubRepo { } // Open will open the GitHub Repo URL using the utils helper -func (repo *GithubRepo) Open() { +func (repo *Repo) Open() { utils.OpenFile(*repo.RemoteRepo.HTMLURL) } -// Open will open the GitHub Pull Requests URL using the utils helper -func (repo *GithubRepo) OpenPulls() { +// OpenPulls will open the GitHub Pull Requests URL using the utils helper +func (repo *Repo) OpenPulls() { utils.OpenFile(*repo.RemoteRepo.HTMLURL + pullRequestsPath) } -// Open will open the GitHub Issues URL using the utils helper -func (repo *GithubRepo) OpenIssues() { +// OpenIssues will open the GitHub Issues URL using the utils helper +func (repo *Repo) OpenIssues() { utils.OpenFile(*repo.RemoteRepo.HTMLURL + issuesPath) } // Refresh reloads the github data via the Github API -func (repo *GithubRepo) Refresh() { +func (repo *Repo) Refresh() { prs, err := repo.loadPullRequests() repo.Err = err repo.PullRequests = prs @@ -73,7 +73,7 @@ func (repo *GithubRepo) Refresh() { /* -------------------- Counts -------------------- */ // IssueCount return the total amount of issues as an int -func (repo *GithubRepo) IssueCount() int { +func (repo *Repo) IssueCount() int { if repo.RemoteRepo == nil { return 0 } @@ -84,12 +84,12 @@ func (repo *GithubRepo) IssueCount() int { } // PullRequestCount returns the total amount of pull requests as an int -func (repo *GithubRepo) PullRequestCount() int { +func (repo *Repo) PullRequestCount() int { return len(repo.PullRequests) } // StarCount returns the total amount of stars this repo has gained as an int -func (repo *GithubRepo) StarCount() int { +func (repo *Repo) StarCount() int { if repo.RemoteRepo == nil { return 0 } @@ -99,7 +99,7 @@ func (repo *GithubRepo) StarCount() int { /* -------------------- Unexported Functions -------------------- */ -func (repo *GithubRepo) isGitHubEnterprise() bool { +func (repo *Repo) isGitHubEnterprise() bool { if len(repo.baseURL) > 0 { if len(repo.uploadURL) == 0 { repo.uploadURL = repo.baseURL @@ -109,7 +109,7 @@ func (repo *GithubRepo) isGitHubEnterprise() bool { return false } -func (repo *GithubRepo) oauthClient() *http.Client { +func (repo *Repo) oauthClient() *http.Client { tokenService := oauth2.StaticTokenSource( &oauth2.Token{AccessToken: repo.apiKey}, ) @@ -117,7 +117,7 @@ func (repo *GithubRepo) oauthClient() *http.Client { return oauth2.NewClient(context.Background(), tokenService) } -func (repo *GithubRepo) githubClient() (*ghb.Client, error) { +func (repo *Repo) githubClient() (*ghb.Client, error) { oauthClient := repo.oauthClient() if repo.isGitHubEnterprise() { @@ -128,7 +128,7 @@ func (repo *GithubRepo) githubClient() (*ghb.Client, error) { } // myPullRequests returns a list of pull requests created by username on this repo -func (repo *GithubRepo) myPullRequests(username string, showStatus bool) []*ghb.PullRequest { +func (repo *Repo) myPullRequests(username string, showStatus bool) []*ghb.PullRequest { prs := []*ghb.PullRequest{} for _, pr := range repo.PullRequests { @@ -149,7 +149,7 @@ func (repo *GithubRepo) myPullRequests(username string, showStatus bool) []*ghb. // individualPRs takes a list of pull requests (presumably returned from // github.PullRequests.List) and fetches them individually to get more detailed // status info on each. see: https://developer.github.com/v3/git/#checking-mergeability-of-pull-requests -func (repo *GithubRepo) individualPRs(prs []*ghb.PullRequest) []*ghb.PullRequest { +func (repo *Repo) individualPRs(prs []*ghb.PullRequest) []*ghb.PullRequest { github, err := repo.githubClient() if err != nil { return prs @@ -170,7 +170,7 @@ func (repo *GithubRepo) individualPRs(prs []*ghb.PullRequest) []*ghb.PullRequest // myReviewRequests returns a list of pull requests for which username has been // requested to do a code review -func (repo *GithubRepo) myReviewRequests(username string) []*ghb.PullRequest { +func (repo *Repo) myReviewRequests(username string) []*ghb.PullRequest { prs := []*ghb.PullRequest{} for _, pr := range repo.PullRequests { @@ -184,7 +184,7 @@ func (repo *GithubRepo) myReviewRequests(username string) []*ghb.PullRequest { return prs } -func (repo *GithubRepo) customIssueQuery(filter string, perPage int) *ghb.IssuesSearchResult { +func (repo *Repo) customIssueQuery(filter string, perPage int) *ghb.IssuesSearchResult { github, err := repo.githubClient() if err != nil { return nil @@ -199,7 +199,7 @@ func (repo *GithubRepo) customIssueQuery(filter string, perPage int) *ghb.Issues return prs } -func (repo *GithubRepo) loadPullRequests() ([]*ghb.PullRequest, error) { +func (repo *Repo) loadPullRequests() ([]*ghb.PullRequest, error) { github, err := repo.githubClient() if err != nil { return nil, err @@ -217,7 +217,7 @@ func (repo *GithubRepo) loadPullRequests() ([]*ghb.PullRequest, error) { return prs, nil } -func (repo *GithubRepo) loadRemoteRepository() (*ghb.Repository, error) { +func (repo *Repo) loadRemoteRepository() (*ghb.Repository, error) { github, err := repo.githubClient() if err != nil { diff --git a/modules/github/widget.go b/modules/github/widget.go index ed8ee7da..9d05e354 100644 --- a/modules/github/widget.go +++ b/modules/github/widget.go @@ -15,7 +15,7 @@ type Widget struct { view.KeyboardWidget view.TextWidget - GithubRepos []*GithubRepo + GithubRepos []*Repo settings *Settings Selected int @@ -110,8 +110,8 @@ func (widget *Widget) HelpText() string { /* -------------------- Unexported Functions -------------------- */ -func (widget *Widget) buildRepoCollection(repoData []string) []*GithubRepo { - githubRepos := []*GithubRepo{} +func (widget *Widget) buildRepoCollection(repoData []string) []*Repo { + githubRepos := []*Repo{} for _, repo := range repoData { split := strings.Split(repo, "/") @@ -130,7 +130,7 @@ func (widget *Widget) buildRepoCollection(repoData []string) []*GithubRepo { return githubRepos } -func (widget *Widget) currentGithubRepo() *GithubRepo { +func (widget *Widget) currentGithubRepo() *Repo { if len(widget.GithubRepos) == 0 { return nil } From c6567d15af88a9d1466249acfd75971586c6b96a Mon Sep 17 00:00:00 2001 From: Sean Smith Date: Wed, 7 Oct 2020 19:39:56 -0400 Subject: [PATCH 40/42] Upgrade travis to 1.15.x (#991) Missed item from previous upgrade --- .travis.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.travis.yml b/.travis.yml index 8a588cff..48948b91 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,7 +1,7 @@ language: go go: - - "1.14.x" + - "1.15.x" before_install: # Make sure travis builds work for forks From 2f70693656339243da635f3f4d44a77ef6e3e353 Mon Sep 17 00:00:00 2001 From: Todd Trimble Date: Thu, 8 Oct 2020 01:11:39 -0400 Subject: [PATCH 41/42] Correct minor typo in clock settings help text (#993) --- modules/clocks/settings.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/modules/clocks/settings.go b/modules/clocks/settings.go index 28c0068f..10ee8579 100644 --- a/modules/clocks/settings.go +++ b/modules/clocks/settings.go @@ -18,7 +18,7 @@ type Settings struct { dateFormat string `help:"The format of the date string for all clocks." values:"Any valid Go date layout which is handled by Time.Format. Defaults to Jan 2."` timeFormat string `help:"The format of the time string for all clocks." values:"Any valid Go time layout which is handled by Time.Format. Defaults to 15:04 MST."` locations []Clock `help:"Defines the timezones for the world clocks that you want to display. key is a unique label that will be displayed in the UI. value is a timezone name." values:"Any TZ database timezone."` - sort string `help:"Defines the display order of the clocks in the widget." values:"'alphabetical', 'chronological', or 'natural. 'alphabetical' will sort in acending order by key, 'chronological' will sort in ascending order by date/time, 'natural' will keep ordering as per the config."` + sort string `help:"Defines the display order of the clocks in the widget." values:"'alphabetical', 'chronological', or 'natural. 'alphabetical' will sort in ascending order by key, 'chronological' will sort in ascending order by date/time, 'natural' will keep ordering as per the config."` } // NewSettingsFromYAML creates a new settings instance from a YAML config block From 534514f558ea2cf9ea4a50d84ca69a25a3f0840f Mon Sep 17 00:00:00 2001 From: Chris Cummer Date: Thu, 8 Oct 2020 11:42:45 -0700 Subject: [PATCH 42/42] go mod tidy Signed-off-by: Chris Cummer --- go.sum | 2 -- 1 file changed, 2 deletions(-) diff --git a/go.sum b/go.sum index 8d74f33c..e1a7ed50 100644 --- a/go.sum +++ b/go.sum @@ -172,8 +172,6 @@ github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSs github.com/dgrijalva/jwt-go v3.2.0+incompatible h1:7qlOGliEKZXTDg6OTjfoBKDXWrumCAMpl/TFQ4/5kLM= github.com/dgrijalva/jwt-go v3.2.0+incompatible/go.mod h1:E3ru+11k8xSBh+hMPgOLZmtrrCbhqsmaPHjLKYnJCaQ= github.com/dgryski/go-sip13 v0.0.0-20181026042036-e10d5fee7954/go.mod h1:vAd38F8PWV+bWy6jNmig1y/TA+kYO4g3RSRF0IAv0no= -github.com/digitalocean/godo v1.44.0 h1:IMElzMUpO1dVR8qjSg53+5vDkOLzMbhJt4yTAq7NGCQ= -github.com/digitalocean/godo v1.44.0/go.mod h1:p7dOjjtSBqCTUksqtA5Fd3uaKs9kyTq2xcz76ulEJRU= github.com/digitalocean/godo v1.46.0 h1:WRbwjATilgz2NE4NGMeSDpeicy9h4xSKNGuRJ/Nq/fA= github.com/digitalocean/godo v1.46.0/go.mod h1:p7dOjjtSBqCTUksqtA5Fd3uaKs9kyTq2xcz76ulEJRU= github.com/dlclark/regexp2 v1.2.0 h1:8sAhBGEM0dRWogWqWyQeIJnxjWO6oIjl8FKqREDsGfk=