1
0
mirror of https://github.com/taigrr/wtf synced 2025-01-18 04:03:14 -08:00

38 Commits

Author SHA1 Message Date
Chris Cummer
fcdb4988f9 Add support for user-configuration language tag specification.
Adds a new top-level configuration key called "language":

```yaml
wtf:
  langauge: "ja-JP"
```

Users can now define which BCP 47 language tag to use to format any
text or numbers that currently support localization. Defaults to
"en-CA".

Acceptible values: any BCP 47 language tag recognized by the Go
"language" package.

Good luck to you figuring out what that cannonical list is. After a
morning of trying to suss it out, I have no idea.

Signed-off-by: Chris Cummer <chriscummer@me.com>
2020-12-29 12:04:17 -08:00
Chris Cummer
f84142553c
WTF-986 User-definable DigitalOcean columns (#1001)
* WTF-986 Wrap the DigitalOcean droplet in our own droplet

This gives us something to build off while still providing the
underlying functionality of the original droplet instance.

Signed-off-by: Chris Cummer <chriscummer@me.com>

* WTF-986 Dynamically display droplet attributes based on defined column names

Signed-off-by: Chris Cummer <chriscummer@me.com>

* WTF-986 Read DigitalOcean column configuration from settings

Signed-off-by: Chris Cummer <chriscummer@me.com>

* WTF-986 Extract the reflection bits into a Reflective package

Signed-off-by: Chris Cummer <chriscummer@me.com>
2020-10-14 09:29:58 -07:00
Sam Roberts
4bb725db9e golangci-lint configuration file
golangci-lint can run all the currently enabled linters, and as far as I
can tell, does it in under 5 seconds as opposed to over 180 seconds
(compare `time make cilint` and `time make lint`).

Some of the linters that are listed in the "enabled" section but
commented out looked like a good idea to me, and fairly low hanging
fruit to fix, but they are not passing at the moment.

All the linters covered in the current Makefile are run.

TODO:
- replace lint target in Makefile with golangci-lint
- remove .github/workflow/errcheck.yml
2020-05-16 12:34:57 -07:00
Chris Cummer
f0ca3b8a58
Another actions test (#889)
* Another actions test

Signed-off-by: Chris Cummer <chriscummer@me.com>

* Add BuildTest action

Signed-off-by: Chris Cummer <chriscummer@me.com>

* Remove lint check for the time being (so many issues)

Signed-off-by: Chris Cummer <chriscummer@me.com>

* Fix issues found by errcheck

Signed-off-by: Chris Cummer <chriscummer@me.com>

* Fix errors found by staticcheck

Signed-off-by: Chris Cummer <chriscummer@me.com>

* Fix issues found by goimports

Signed-off-by: Chris Cummer <chriscummer@me.com>

* Comment out the  action for the time being

Signed-off-by: Chris Cummer <chriscummer@me.com>

* Fix shadowed variables

Signed-off-by: Chris Cummer <chriscummer@me.com>

* go mod tidy

Signed-off-by: Chris Cummer <chriscummer@me.com>

* Remove buildtest.yml

Signed-off-by: Chris Cummer <chriscummer@me.com>

* go mod tidy

Signed-off-by: Chris Cummer <chriscummer@me.com>
2020-05-09 12:51:08 -07:00
Chris Cummer
8dde85989d
Remove some unnecessary type conversions (#841)
* Remove some unnecessary type conversions

Signed-off-by: Chris Cummer <chriscummer@me.com>

* Tidy'd go.mod

Signed-off-by: Chris Cummer <chriscummer@me.com>
2020-02-15 13:02:10 -08:00
Bjoern Weidlich
86b32b3f9f Adding twitch module to display top streams (#805) 2019-12-30 22:20:53 -05:00
Chris Cummer
ac2817613b Fix a spelling mistake in a comment:
Signed-off-by: Chris Cummer <chriscummer@me.com>
2019-12-21 07:59:02 -08:00
Chris Cummer
10f761dbcb
20191217 gosec (#796)
* Add gosec to the Makefile

Signed-off-by: Chris Cummer <chriscummer@me.com>

* Fix some issues found by gosec

Signed-off-by: Chris Cummer <chriscummer@me.com>
2019-12-17 14:59:16 -08:00
Chris Cummer
cde904ff08
Use errcheck to find unhandled errors (#795)
Signed-off-by: Chris Cummer <chriscummer@me.com>
2019-12-17 08:26:16 -08:00
Chris Cummer
140dd553e0
WTF-781 Todoist project ID conversion (#789)
* WTF-781 Switch Todoist IDs from `int` to `string`

On platforms that convert an `int` to `int32`, like the Raspberry Pi,
an `int` is not large enough to store Todoist project IDs.

Using a `string` ensures this never becomes a problem.

Fixes #781

Signed-off-by: Chris Cummer <chriscummer@me.com>
2019-12-16 20:25:52 -08:00
Chris Cummer
3a388fba23
20191215 code improvements (#790)
* Upgrade godo to latest
* Fix a bunch of issues found by
* Running staticcheck on a codebase for the first time is a sobering experience
* go mod tidy
* More static improvements

Signed-off-by: Chris Cummer <chriscummer@me.com>
2019-12-16 20:25:29 -08:00
Chris Cummer
1686c9a6a9 Add small_config.yml for testing
Signed-off-by: Chris Cummer <chriscummer@me.com>
2019-12-13 22:33:28 -08:00
Chris Cummer
58299c2efa
WTF-484 DigitalOcean module (#782)
* WTF-484 DigitalOcean module stubbed out
* WTF-484 Delete droplets via Ctrl-d
* WTF-484 Rebasing off master after a long time away
* WTF-484 Improve DigitalOcean display
* WTF-484 Can shutdown and restart the selected droplet
* WTF-484 Display info about the selected droplet using the ? key
* WTF-484 Display info about the selected droplet using the Return key
* WTF-484 Greatly improve the utils.Truncate function
* WTF-484 Display a droplet's features in the info modal
* WTF-484 Change reboot key from r to b to not conflict with refresh
* WTF-484 Panic if a keyboard control is mapped to the same character more than once
* WTF-484 Colorize droplet status indicator
* WTF-484 Extract view.InfoTable out into a reusable component
2019-12-13 11:33:29 -08:00
Chris Cummer
251e3fe10d
Add warning for empty grid values (#741)
Signed-off-by: Chris Cummer <chriscummer@me.com>
2019-11-09 15:13:30 -08:00
Chris Cummer
b2093314f0 Fix grid: key issue when key is present
Really do need it to work with and without a grid: key.

Signed-off-by: Chris Cummer <chriscummer@me.com>
2019-11-09 14:13:47 -08:00
Chris Cummer
a18fce88ac
WTF-718 Fixes missing grid issue when running CmdRunner (#740)
Closes #718 and closes #730.

Signed-off-by: Chris Cummer <chriscummer@me.com>
2019-11-09 14:09:13 -08:00
Chris Cummer
1bfca29d17
WTF-657 Add spec coverage for cfg/common_settings.go (#728)
* WTF-657 Add spec coverage for cfg/common_settings.go

Signed-off-by: Chris Cummer <chriscummer@me.com>

* WTF-657 Add spec coverage for cfg/position_validation.go

Signed-off-by: Chris Cummer <chriscummer@me.com>

* WTF-657 Add spec coverage for cfg/validations.go

Signed-off-by: Chris Cummer <chriscummer@me.com>

* WTF-657 Add spec coverage for checklist/checklist.go

Signed-off-by: Chris Cummer <chriscummer@me.com>

* WTF-657 Add spec coverage for checklist/checklist_item.go

Signed-off-by: Chris Cummer <chriscummer@me.com>

* WTF-657 Add spec coverage for utils/conversions.go

Signed-off-by: Chris Cummer <chriscummer@me.com>

* WTF-657 Get rid of utils.Home() function

Signed-off-by: Chris Cummer <chriscummer@me.com>

* WTF-657 Add spec coverage for utils/homedir.go

Signed-off-by: Chris Cummer <chriscummer@me.com>

* WTF-657 Add spec coverage for utils/text.go

Signed-off-by: Chris Cummer <chriscummer@me.com>

* WTF-657 Clean up utils/utils.go

Signed-off-by: Chris Cummer <chriscummer@me.com>
2019-10-30 17:35:00 -07:00
Chris Cummer
2918e49346 Fix failing specs
Signed-off-by: Chris Cummer <chriscummer@me.com>
2019-10-15 15:33:03 -04:00
Chris Cummer
e43430e7ad Merge branch 'openutilupdate' of github.com:Seanstoppable/wtf into Seanstoppable-openutilupdate 2019-10-15 15:27:56 -04:00
Tim Scheuermann
226796099c Revert "Revert "Call the os.UserHomeDir in Home""
This reverts commit 270daf31ea007147e1b04770e501688472750a7e.
2019-10-15 11:09:03 +02:00
Sean Smith
68e56eaa10 Add new urlutil option, and have these be reloadable
Handles #897 and part of #593
2019-10-12 17:44:28 -04:00
Tim Scheuermann
270daf31ea Revert "Call the os.UserHomeDir in Home"
This reverts commit d3b6bc503a583bd2d841a9fba439b9f7e4056ff0.
2019-10-11 23:36:21 +02:00
Tim Scheuermann
d3b6bc503a Call the os.UserHomeDir in Home 2019-10-11 23:18:08 +02:00
Tim Scheuermann
cdf37f053c Optimized ParseJson and ExecuteCommand 2019-10-11 23:17:01 +02:00
Tim Scheuermann
5b4a49d11f Preallocate slice 2019-10-11 23:13:38 +02:00
Tim Scheuermann
ca18a14d43 Preallocate slices and remove double type assertion 2019-10-11 23:13:18 +02:00
Tim Scheuermann
4ef6eb76c6 Added utils.CalculateDimensions 2019-10-09 14:54:47 +02:00
Chris Cummer
7c2d6b4c42 WTF-665 Add time format setting for gCal module
Allows the user to specify either "12" or "24" to set whether or not to
display times in AM/PM format or 24-hour format.

Example:

      gcal:
        enabled: true
        timeFormat: "12"
        refreshInterval: 360

Fixes #665
2019-10-01 21:37:03 -07:00
Sean Smith
36fbad54d8 Fix JSON parsing
Issue #600 points out Jenkins module panics occasionally
I noticed that a number of places panic because of JSON parsing
Centralize JSON parsing, have it return an error, and have widgets
report the error
2019-09-07 15:14:33 -04:00
Christopher Hall
e8bb4070d9 use xdg-open as default open method for http/https
This should be available on all BSD and similar OSs

Signed-off-by: Christopher Hall <hsw@ms2.hinet.net>
2019-08-28 11:33:28 +08:00
Chris Cummer
c832db9ddb Add utils.Includes() helper function 2019-08-20 16:39:15 -07:00
Chris Cummer
0db7e7c533 Catch intermittent failure with HIBP module 2019-08-05 17:57:29 -07:00
Chris Cummer
3e2d6eb5fa Fix the naming and specs for some utility functions 2019-08-05 11:40:42 -07:00
Chris Cummer
ecd95ba2d2 Move a bunch of code out of utils.go and into dedicated files 2019-08-05 11:16:26 -07:00
Chris Cummer
4e46fff145 Move the utils.go file into the /utils directory 2019-08-05 10:50:12 -07:00
Chris Cummer
2da3344612 Get --module=[modname] working again (broke when position config validation was added) 2019-07-06 01:55:54 -07:00
Sean Smith
d8f337884f Add more 'man page' like functionality 2019-05-24 00:06:10 -04:00
Sean Smith
c328ba4c11 Split up logger and widget
This allows us to use the logger from the wtf directory
For example when trying to debug sort ordering in focus_tracker
2019-05-10 19:07:52 -04:00