Skip to content

Commit

Permalink
Move to go mod (#70)
Browse files Browse the repository at this point in the history
  • Loading branch information
lucapette authored Feb 19, 2022
1 parent 8fbe201 commit ade74e7
Show file tree
Hide file tree
Showing 45 changed files with 77 additions and 4,372 deletions.
25 changes: 25 additions & 0 deletions .github/workflows/go.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
name: Go

on:
push:
branches: [ '*' ]
pull_request:
branches: [ '*' ]

jobs:

build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2

- name: Set up Go
uses: actions/setup-go@v2
with:
go-version: 1.17

- name: build
run: make build

- name: test
run: make test
21 changes: 21 additions & 0 deletions .github/workflows/lint.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
name: golangci-lint
on:
push:
branches: [ '*' ]
pull_request:
branches: [ '*' ]
permissions:
contents: read
# Optional: allow read access to pull request. Use with `only-new-issues` option.
# pull-requests: read
jobs:
golangci:
name: lint
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: golangci-lint
uses: golangci/golangci-lint-action@v2
with:
# Optional: version of golangci-lint to use in form of v1.2 or v1.2.3 or `latest` to use the latest version
version: v1.29
8 changes: 0 additions & 8 deletions .travis.yml

This file was deleted.

8 changes: 1 addition & 7 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ Which shows all the documented targets. `fakedata` is written in
code:

* `make`
* [Go 1.9+](http://golang.org/doc/install)
* [Go 1.16+](http://golang.org/doc/install)

Clone `fakedata` from source:

Expand All @@ -27,12 +27,6 @@ $ git clone https://github.com/lucapette/fakedata.git
$ cd fakedata
```

Install the build and lint dependencies:

```sh
$ make setup
```

A good way of making sure everything is all right is running the test suite:

```sh
Expand Down
36 changes: 0 additions & 36 deletions Gopkg.lock

This file was deleted.

25 changes: 0 additions & 25 deletions Gopkg.toml

This file was deleted.

15 changes: 1 addition & 14 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -2,24 +2,11 @@ SOURCE_FILES?=$$(go list ./...)
TEST_PATTERN?=.
TEST_OPTIONS?=

setup: ## Install all the build and lint dependencies
go get -u --insecure github.com/golang/dep/cmd/dep
go get -u github.com/alecthomas/gometalinter
gometalinter --install
dep ensure

test: ## Run all the tests
go test $(TEST_OPTIONS) -cover $(SOURCE_FILES) -run $(TEST_PATTERN) -timeout=30s

lint: ## Run all the linters
gometalinter --vendor --disable-all \
--enable=vet \
--enable=gofmt \
--enable=errcheck \
--enable=golint \
./...

ci: lint test ## Run all the tests and code checks
golangci-lint run

build: ## Build a dev version of fakedata
go build
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -388,4 +388,4 @@ covenant](http://contributor-covenant.org/) initiative!

# License

[MIT License](/LICENSE) Copyright (c) [2017] [Luca Pette](http://lucapette.me)
[MIT License](/LICENSE) Copyright (c) [2022] [Luca Pette](https://lucapette.me)
10 changes: 10 additions & 0 deletions go.mod
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
module github.com/lucapette/fakedata

go 1.17

require (
github.com/kr/pretty v0.0.0-20160823170715-cfb55aafdaf3
github.com/spf13/pflag v1.0.0
)

require github.com/kr/text v0.0.0-20160504234017-7cafcd837844 // indirect
6 changes: 6 additions & 0 deletions go.sum
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
github.com/kr/pretty v0.0.0-20160823170715-cfb55aafdaf3 h1:dhwb1Ev84SKKVBfLuhR4bw/29yYHzwtTyTLUWWnvYxI=
github.com/kr/pretty v0.0.0-20160823170715-cfb55aafdaf3/go.mod h1:Bvhd+E3laJ0AVkG0c9rmtZcnhV0HQ3+c3YxxqTvc/gA=
github.com/kr/text v0.0.0-20160504234017-7cafcd837844 h1:kpzneEBeC0dMewP3gr/fADv1OlblH9r1goWVwpOt3TU=
github.com/kr/text v0.0.0-20160504234017-7cafcd837844/go.mod h1:sjUstKUATFIcff4qlB53Kml0wQPtJVc/3fWrmuUmcfA=
github.com/spf13/pflag v1.0.0 h1:oaPbdDe/x0UncahuwiPxW1GYJyilRAdsPnq3e1yaPcI=
github.com/spf13/pflag v1.0.0/go.mod h1:DYY7MBk1bdzusC3SYhjObp+wFpr4gzcvqqNjLnInEg4=
2 changes: 1 addition & 1 deletion integration/cli_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ import (

// In the following tests, there's a lot going on.
// Please have a look at the following article for a longer explanation:
// http://lucapette.me/writing-integration-tests-for-a-go-cli-application
// https://lucapette.me/writing-integration-tests-for-a-go-cli-application

var update = flag.Bool("update", false, "update golden files")

Expand Down
2 changes: 1 addition & 1 deletion pkg/data/occupations.go

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion pkg/data/sentences.go

Large diffs are not rendered by default.

Loading

0 comments on commit ade74e7

Please sign in to comment.