Skip to content

Commit

Permalink
Start changing the imports of the middle level files.
Browse files Browse the repository at this point in the history
  • Loading branch information
jameinel committed Jul 9, 2013
1 parent 54cb931 commit 844d00f
Show file tree
Hide file tree
Showing 139 changed files with 412 additions and 179 deletions.
23 changes: 23 additions & 0 deletions CONTRIBUTING
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,29 @@ You can also list any branches you are currently working on by

bzr branch


Imports
-------

Import statements are grouped into 3 sections: standard library, 3rd party
libraries, juju-core imports. The tool "go fmt" can be used to ensure each
group is alphabetically sorted. eg:

import (
"fmt"
"time"

"labix.org/v2/mgo"
gc "launchpad.net/gocheck"
"launchpad.net/loggo"

"launchpad.net/juju-core/state"
"launchpad.net/juju-core/worker"
)

Because "launchpad.net/gocheck" will be referenced frequently in test suites,
its name gets a default short name of just "gc".

Testing
=======

Expand Down
6 changes: 4 additions & 2 deletions bzr/bzr_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,13 @@
package bzr_test

import (
. "launchpad.net/gocheck"
"launchpad.net/juju-core/bzr"
"os"
"os/exec"
"testing"

. "launchpad.net/gocheck"

"launchpad.net/juju-core/bzr"
)

func Test(t *testing.T) {
Expand Down
6 changes: 4 additions & 2 deletions cert/cert_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -11,12 +11,14 @@ import (
"fmt"
"io"
"io/ioutil"
. "launchpad.net/gocheck"
"launchpad.net/juju-core/cert"
"net"
"strings"
"testing"
"time"

. "launchpad.net/gocheck"

"launchpad.net/juju-core/cert"
)

func TestAll(t *testing.T) {
Expand Down
10 changes: 6 additions & 4 deletions charm/bundle_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,15 +8,17 @@ import (
"bytes"
"fmt"
"io/ioutil"
. "launchpad.net/gocheck"
"launchpad.net/goyaml"
"launchpad.net/juju-core/charm"
"launchpad.net/juju-core/testing"
"os"
"os/exec"
"path/filepath"
"strconv"
"syscall"

. "launchpad.net/gocheck"
"launchpad.net/goyaml"

"launchpad.net/juju-core/charm"
"launchpad.net/juju-core/testing"
)

type BundleSuite struct {
Expand Down
4 changes: 3 additions & 1 deletion charm/charm_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,13 @@ import (
"bytes"
"io"
"io/ioutil"
stdtesting "testing"

. "launchpad.net/gocheck"
"launchpad.net/goyaml"

"launchpad.net/juju-core/charm"
"launchpad.net/juju-core/testing"
stdtesting "testing"
)

func Test(t *stdtesting.T) {
Expand Down
1 change: 1 addition & 0 deletions charm/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ import (
"strconv"

"launchpad.net/goyaml"

"launchpad.net/juju-core/schema"
)

Expand Down
2 changes: 2 additions & 0 deletions charm/config_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,9 @@ package charm_test
import (
"bytes"
"fmt"

. "launchpad.net/gocheck"

"launchpad.net/juju-core/charm"
)

Expand Down
3 changes: 2 additions & 1 deletion charm/dir.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,11 +9,12 @@ import (
"fmt"
"io"
"io/ioutil"
"launchpad.net/juju-core/log"
"os"
"path/filepath"
"strconv"
"syscall"

"launchpad.net/juju-core/log"
)

// The Dir type encapsulates access to data and operations
Expand Down
8 changes: 5 additions & 3 deletions charm/dir_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,13 +8,15 @@ import (
"bytes"
"fmt"
"io/ioutil"
. "launchpad.net/gocheck"
"launchpad.net/juju-core/charm"
"launchpad.net/juju-core/testing"
"os"
"path/filepath"
"strings"
"syscall"

. "launchpad.net/gocheck"

"launchpad.net/juju-core/charm"
"launchpad.net/juju-core/testing"
)

type DirSuite struct {
Expand Down
4 changes: 3 additions & 1 deletion charm/meta.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,12 @@ import (
"fmt"
"io"
"io/ioutil"
"strings"

"launchpad.net/goyaml"

"launchpad.net/juju-core/charm/hooks"
"launchpad.net/juju-core/schema"
"strings"
)

// RelationScope describes the scope of a relation.
Expand Down
8 changes: 5 additions & 3 deletions charm/meta_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,12 +7,14 @@ import (
"bytes"
"io"
"io/ioutil"
. "launchpad.net/gocheck"
"launchpad.net/juju-core/charm"
"launchpad.net/juju-core/testing"
"os"
"path/filepath"
"strings"

. "launchpad.net/gocheck"

"launchpad.net/juju-core/charm"
"launchpad.net/juju-core/testing"
)

func repoMeta(name string) io.Reader {
Expand Down
3 changes: 2 additions & 1 deletion charm/repo.go
Original file line number Diff line number Diff line change
Expand Up @@ -10,12 +10,13 @@ import (
"fmt"
"io"
"io/ioutil"
"launchpad.net/juju-core/log"
"net/http"
"net/url"
"os"
"path/filepath"
"strings"

"launchpad.net/juju-core/log"
)

// CacheDir stores the charm cache directory path.
Expand Down
8 changes: 5 additions & 3 deletions charm/repo_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,15 +9,17 @@ import (
"encoding/json"
"fmt"
"io/ioutil"
. "launchpad.net/gocheck"
"launchpad.net/juju-core/charm"
"launchpad.net/juju-core/testing"
"net"
"net/http"
"os"
"path/filepath"
"strconv"
"strings"

. "launchpad.net/gocheck"

"launchpad.net/juju-core/charm"
"launchpad.net/juju-core/testing"
)

type MockStore struct {
Expand Down
3 changes: 2 additions & 1 deletion charm/url.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,11 @@ package charm
import (
"encoding/json"
"fmt"
"labix.org/v2/mgo/bson"
"regexp"
"strconv"
"strings"

"labix.org/v2/mgo/bson"
)

// A charm URL represents charm locations such as:
Expand Down
2 changes: 2 additions & 0 deletions charm/url_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,10 @@ package charm_test
import (
"encoding/json"
"fmt"

"labix.org/v2/mgo/bson"
. "launchpad.net/gocheck"

"launchpad.net/juju-core/charm"
)

Expand Down
4 changes: 3 additions & 1 deletion cloudinit/cloudinit_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,11 @@ package cloudinit_test

import (
"fmt"
"testing"

. "launchpad.net/gocheck"

"launchpad.net/juju-core/cloudinit"
"testing"
)

// TODO integration tests, but how?
Expand Down
3 changes: 2 additions & 1 deletion cmd/builddb/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,11 +9,12 @@ import (
"path/filepath"
"time"

"launchpad.net/loggo"

"launchpad.net/juju-core/charm"
"launchpad.net/juju-core/environs"
"launchpad.net/juju-core/juju"
"launchpad.net/juju-core/state/api/params"
"launchpad.net/loggo"
)

// Import the providers.
Expand Down
6 changes: 4 additions & 2 deletions cmd/charmd/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,13 @@ package main
import (
"fmt"
"io/ioutil"
"launchpad.net/goyaml"
"launchpad.net/juju-core/store"
"net/http"
"os"
"path/filepath"

"launchpad.net/goyaml"

"launchpad.net/juju-core/store"
)

func main() {
Expand Down
3 changes: 2 additions & 1 deletion cmd/cmd.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,11 @@ import (
"fmt"
"io"
"io/ioutil"
"launchpad.net/gnuflag"
"os"
"path/filepath"
"strings"

"launchpad.net/gnuflag"
)

// ErrSilent can be returned from Run to signal that Main should exit with
Expand Down
6 changes: 4 additions & 2 deletions cmd/cmd_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,13 @@ package cmd_test

import (
"bytes"
"path/filepath"
stdtesting "testing"

. "launchpad.net/gocheck"

"launchpad.net/juju-core/cmd"
"launchpad.net/juju-core/testing"
"path/filepath"
stdtesting "testing"
)

func Test(t *stdtesting.T) { TestingT(t) }
Expand Down
4 changes: 3 additions & 1 deletion cmd/filevar_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,13 @@
package cmd_test

import (
"os"

"launchpad.net/gnuflag"
. "launchpad.net/gocheck"

"launchpad.net/juju-core/cmd"
"launchpad.net/juju-core/testing"
"os"
)

type FileVarSuite struct {
Expand Down
3 changes: 2 additions & 1 deletion cmd/logging_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,11 @@ import (
"path/filepath"

. "launchpad.net/gocheck"
"launchpad.net/loggo"

"launchpad.net/juju-core/cmd"
"launchpad.net/juju-core/log"
"launchpad.net/juju-core/testing"
"launchpad.net/loggo"
)

type LogSuite struct {
Expand Down
5 changes: 3 additions & 2 deletions cmd/output.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,12 +7,13 @@ import (
"encoding/json"
"fmt"
"io"
"launchpad.net/gnuflag"
"launchpad.net/goyaml"
"os"
"reflect"
"sort"
"strings"

"launchpad.net/gnuflag"
"launchpad.net/goyaml"
)

// Formatter converts an arbitrary object into a []byte.
Expand Down
1 change: 1 addition & 0 deletions cmd/output_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ package cmd_test
import (
"launchpad.net/gnuflag"
. "launchpad.net/gocheck"

"launchpad.net/juju-core/cmd"
"launchpad.net/juju-core/testing"
)
Expand Down
1 change: 1 addition & 0 deletions cmd/supercommand.go
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ import (
"strings"

"launchpad.net/gnuflag"

"launchpad.net/juju-core/log"
)

Expand Down
1 change: 1 addition & 0 deletions cmd/supercommand_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ import (
"fmt"

. "launchpad.net/gocheck"

"launchpad.net/juju-core/cmd"
"launchpad.net/juju-core/testing"
)
Expand Down
2 changes: 2 additions & 0 deletions cmd/util_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,9 @@ import (
"errors"
"fmt"
"io"

"launchpad.net/gnuflag"

"launchpad.net/juju-core/cmd"
)

Expand Down
Loading

0 comments on commit 844d00f

Please sign in to comment.