Skip to content

Commit

Permalink
chore: kebab-case to snake_case all source and test files (#2057)
Browse files Browse the repository at this point in the history
<!-- please provide a detailed description of the changes made in this
pull request. -->

<details><summary>Contributors' checklist...</summary>

- [ ] Added new tests, or not needed, or not feasible
- [ ] Provided an example (e.g. screenshot) to aid review or the PR is
self-explanatory
- [ ] Updated the official documentation or not needed
- [ ] No breaking changes were made, or a `BREAKING CHANGE: xxx` message
was included in the description
- [ ] Added references to related issues and PRs
- [ ] Provided any useful hints for running manual tests
- [ ] Added new benchmarks to [generated
graphs](https://gnoland.github.io/benchmarks), if any. More info
[here](https://github.com/gnolang/gno/blob/master/.benchmarks/README.md).
</details>
  • Loading branch information
thehowl authored May 12, 2024
1 parent a03eeb3 commit dc6eb7d
Show file tree
Hide file tree
Showing 90 changed files with 200 additions and 201 deletions.
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
package upgradea

import (
v1 "gno.land/r/x/manfred_upgrade_patterns/upgrade-a/v1"
v2 "gno.land/r/x/manfred_upgrade_patterns/upgrade-a/v2"
v1 "gno.land/r/x/manfred_upgrade_patterns/upgrade_a/v1"
v2 "gno.land/r/x/manfred_upgrade_patterns/upgrade_a/v2"
)

func main() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ package upgradea
import (
"strconv"

v1 "gno.land/r/x/manfred_upgrade_patterns/upgrade-a/v1"
v1 "gno.land/r/x/manfred_upgrade_patterns/upgrade_a/v1"
)

var counter int
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ package upgradeb
import (
"std"

v1 "gno.land/r/x/manfred_upgrade_patterns/upgrade-b/v1"
v1 "gno.land/r/x/manfred_upgrade_patterns/upgrade_b/v1"
)

const admin = "blahblah"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ package root

var (
counter int
currentImplementation = "gno.land/r/x/manfred_upgrade_patterns/upgrade-c/v1"
currentImplementation = "gno.land/r/x/manfred_upgrade_patterns/upgrade_c/v1"
)

func Inc() int {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
package v1

import "gno.land/r/x/manfred_upgrade_patterns/upgrade-c/root"
import "gno.land/r/x/manfred_upgrade_patterns/upgrade_c/root"

func Inc() {
root.Inc()
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
package v1

import "gno.land/r/x/manfred_upgrade_patterns/upgrade-c/root"
import "gno.land/r/x/manfred_upgrade_patterns/upgrade_c/root"

func Inc() {
root.Inc()
Expand Down
4 changes: 2 additions & 2 deletions gnovm/cmd/gno/clean_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -23,13 +23,13 @@ func TestCleanApp(t *testing.T) {
},
{
args: []string{"clean"},
testDir: "../../tests/integ/empty-dir",
testDir: "../../tests/integ/empty_dir",
simulateExternalRepo: true,
errShouldBe: "not a gno module: gno.mod file not found in current or any parent directory",
},
{
args: []string{"clean"},
testDir: "../../tests/integ/minimalist-gnomod",
testDir: "../../tests/integ/minimalist_gnomod",
simulateExternalRepo: true,
},
}
Expand Down
16 changes: 8 additions & 8 deletions gnovm/cmd/gno/lint_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,22 +8,22 @@ func TestLintApp(t *testing.T) {
args: []string{"lint"},
errShouldBe: "flag: help requested",
}, {
args: []string{"lint", "--set-exit-status=0", "../../tests/integ/run-main/"},
stderrShouldContain: "./../../tests/integ/run-main: missing 'gno.mod' file (code=1).",
args: []string{"lint", "--set-exit-status=0", "../../tests/integ/run_main/"},
stderrShouldContain: "./../../tests/integ/run_main: missing 'gno.mod' file (code=1).",
}, {
args: []string{"lint", "--set-exit-status=0", "../../tests/integ/undefined-variable-test/undefined_variables_test.gno"},
args: []string{"lint", "--set-exit-status=0", "../../tests/integ/undefined_variable_test/undefined_variables_test.gno"},
stderrShouldContain: "undefined_variables_test.gno:6: name toto not declared (code=2)",
}, {
args: []string{"lint", "--set-exit-status=0", "../../tests/integ/package-not-declared/main.gno"},
args: []string{"lint", "--set-exit-status=0", "../../tests/integ/package_not_declared/main.gno"},
stderrShouldContain: "main.gno:4: name fmt not declared (code=2).",
}, {
args: []string{"lint", "--set-exit-status=0", "../../tests/integ/run-main/"},
stderrShouldContain: "./../../tests/integ/run-main: missing 'gno.mod' file (code=1).",
args: []string{"lint", "--set-exit-status=0", "../../tests/integ/run_main/"},
stderrShouldContain: "./../../tests/integ/run_main: missing 'gno.mod' file (code=1).",
}, {
args: []string{"lint", "--set-exit-status=0", "../../tests/integ/minimalist-gnomod/"},
args: []string{"lint", "--set-exit-status=0", "../../tests/integ/minimalist_gnomod/"},
// TODO: raise an error because there is a gno.mod, but no .gno files
}, {
args: []string{"lint", "--set-exit-status=0", "../../tests/integ/invalid-module-name/"},
args: []string{"lint", "--set-exit-status=0", "../../tests/integ/invalid_module_name/"},
// TODO: raise an error because gno.mod is invalid
},

Expand Down
72 changes: 36 additions & 36 deletions gnovm/cmd/gno/mod_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -19,63 +19,63 @@ func TestModApp(t *testing.T) {
// test `gno mod download`
{
args: []string{"mod", "download"},
testDir: "../../tests/integ/empty-dir",
testDir: "../../tests/integ/empty_dir",
simulateExternalRepo: true,
errShouldBe: "gno.mod not found",
},
{
args: []string{"mod", "download"},
testDir: "../../tests/integ/empty-gnomod",
testDir: "../../tests/integ/empty_gnomod",
simulateExternalRepo: true,
errShouldBe: "validate: requires module",
},
{
args: []string{"mod", "download"},
testDir: "../../tests/integ/invalid-module-name",
testDir: "../../tests/integ/invalid_module_name",
simulateExternalRepo: true,
errShouldContain: "usage: module module/path",
},
{
args: []string{"mod", "download"},
testDir: "../../tests/integ/minimalist-gnomod",
testDir: "../../tests/integ/minimalist_gnomod",
simulateExternalRepo: true,
},
{
args: []string{"mod", "download"},
testDir: "../../tests/integ/require-remote-module",
testDir: "../../tests/integ/require_remote_module",
simulateExternalRepo: true,
},
{
args: []string{"mod", "download"},
testDir: "../../tests/integ/require-invalid-module",
testDir: "../../tests/integ/require_invalid_module",
simulateExternalRepo: true,
errShouldContain: "fetch: writepackage: querychain",
},
{
args: []string{"mod", "download"},
testDir: "../../tests/integ/invalid-module-version1",
testDir: "../../tests/integ/invalid_module_version1",
simulateExternalRepo: true,
errShouldContain: "usage: require module/path v1.2.3",
},
{
args: []string{"mod", "download"},
testDir: "../../tests/integ/invalid-module-version2",
testDir: "../../tests/integ/invalid_module_version2",
simulateExternalRepo: true,
errShouldContain: "invalid: must be of the form v1.2.3",
},
{
args: []string{"mod", "download"},
testDir: "../../tests/integ/replace-with-dir",
testDir: "../../tests/integ/replace_with_dir",
simulateExternalRepo: true,
},
{
args: []string{"mod", "download"},
testDir: "../../tests/integ/replace-with-module",
testDir: "../../tests/integ/replace_with_module",
simulateExternalRepo: true,
},
{
args: []string{"mod", "download"},
testDir: "../../tests/integ/replace-with-invalid-module",
testDir: "../../tests/integ/replace_with_invalid_module",
simulateExternalRepo: true,
errShouldContain: "fetch: writepackage: querychain",
},
Expand All @@ -88,90 +88,90 @@ func TestModApp(t *testing.T) {
},
{
args: []string{"mod", "init"},
testDir: "../../tests/integ/empty-dir",
testDir: "../../tests/integ/empty_dir",
simulateExternalRepo: true,
errShouldBe: "create gno.mod file: cannot determine package name",
},
{
args: []string{"mod", "init"},
testDir: "../../tests/integ/empty-gno1",
testDir: "../../tests/integ/empty_gno1",
simulateExternalRepo: true,
recoverShouldContain: "expected 'package', found 'EOF'",
},
{
args: []string{"mod", "init"},
testDir: "../../tests/integ/empty-gno2",
testDir: "../../tests/integ/empty_gno2",
simulateExternalRepo: true,
recoverShouldContain: "expected 'package', found 'EOF'",
},
{
args: []string{"mod", "init"},
testDir: "../../tests/integ/empty-gno3",
testDir: "../../tests/integ/empty_gno3",
simulateExternalRepo: true,
recoverShouldContain: "expected 'package', found 'EOF'",
},
{
args: []string{"mod", "init"},
testDir: "../../tests/integ/empty-gnomod",
testDir: "../../tests/integ/empty_gnomod",
simulateExternalRepo: true,
errShouldBe: "create gno.mod file: gno.mod file already exists",
},

// test `gno mod init` with module name
{
args: []string{"mod", "init", "gno.land/p/demo/foo"},
testDir: "../../tests/integ/empty-dir",
testDir: "../../tests/integ/empty_dir",
simulateExternalRepo: true,
},
{
args: []string{"mod", "init", "gno.land/p/demo/foo"},
testDir: "../../tests/integ/empty-gno1",
testDir: "../../tests/integ/empty_gno1",
simulateExternalRepo: true,
},
{
args: []string{"mod", "init", "gno.land/p/demo/foo"},
testDir: "../../tests/integ/empty-gno2",
testDir: "../../tests/integ/empty_gno2",
simulateExternalRepo: true,
},
{
args: []string{"mod", "init", "gno.land/p/demo/foo"},
testDir: "../../tests/integ/empty-gno3",
testDir: "../../tests/integ/empty_gno3",
simulateExternalRepo: true,
},
{
args: []string{"mod", "init", "gno.land/p/demo/foo"},
testDir: "../../tests/integ/empty-gnomod",
testDir: "../../tests/integ/empty_gnomod",
simulateExternalRepo: true,
errShouldBe: "create gno.mod file: gno.mod file already exists",
},

// test `gno mod tidy`
{
args: []string{"mod", "tidy", "arg1"},
testDir: "../../tests/integ/minimalist-gnomod",
testDir: "../../tests/integ/minimalist_gnomod",
simulateExternalRepo: true,
errShouldContain: "flag: help requested",
},
{
args: []string{"mod", "tidy"},
testDir: "../../tests/integ/empty-dir",
testDir: "../../tests/integ/empty_dir",
simulateExternalRepo: true,
errShouldContain: "could not read gno.mod file",
},
{
args: []string{"mod", "tidy"},
testDir: "../../tests/integ/invalid-module-version1",
testDir: "../../tests/integ/invalid_module_version1",
simulateExternalRepo: true,
errShouldContain: "error parsing gno.mod file at",
},
{
args: []string{"mod", "tidy"},
testDir: "../../tests/integ/minimalist-gnomod",
testDir: "../../tests/integ/minimalist_gnomod",
simulateExternalRepo: true,
},
{
args: []string{"mod", "tidy"},
testDir: "../../tests/integ/require-remote-module",
testDir: "../../tests/integ/require_remote_module",
simulateExternalRepo: true,
},
{
Expand All @@ -181,47 +181,47 @@ func TestModApp(t *testing.T) {
},
{
args: []string{"mod", "tidy"},
testDir: "../../tests/integ/invalid-gno-file",
testDir: "../../tests/integ/invalid_gno_file",
simulateExternalRepo: true,
errShouldContain: "expected 'package', found packag",
},

// test `gno mod why`
{
args: []string{"mod", "why"},
testDir: "../../tests/integ/minimalist-gnomod",
testDir: "../../tests/integ/minimalist_gnomod",
simulateExternalRepo: true,
errShouldContain: "flag: help requested",
},
{
args: []string{"mod", "why", "std"},
testDir: "../../tests/integ/empty-dir",
testDir: "../../tests/integ/empty_dir",
simulateExternalRepo: true,
errShouldContain: "could not read gno.mod file",
},
{
args: []string{"mod", "why", "std"},
testDir: "../../tests/integ/invalid-module-version1",
testDir: "../../tests/integ/invalid_module_version1",
simulateExternalRepo: true,
errShouldContain: "error parsing gno.mod file at",
},
{
args: []string{"mod", "why", "std"},
testDir: "../../tests/integ/invalid-gno-file",
testDir: "../../tests/integ/invalid_gno_file",
simulateExternalRepo: true,
errShouldContain: "expected 'package', found packag",
},
{
args: []string{"mod", "why", "std"},
testDir: "../../tests/integ/minimalist-gnomod",
testDir: "../../tests/integ/minimalist_gnomod",
simulateExternalRepo: true,
stdoutShouldBe: `# std
(module minim does not need package std)
`,
},
{
args: []string{"mod", "why", "std"},
testDir: "../../tests/integ/require-remote-module",
testDir: "../../tests/integ/require_remote_module",
simulateExternalRepo: true,
stdoutShouldBe: `# std
(module gno.land/tests/importavl does not need package std)
Expand Down Expand Up @@ -308,10 +308,10 @@ func TestGetGnoImports(t *testing.T) {
name: filepath.Join("subtmp", "file1.gno"),
data: `
package subtmp
import (
"std"
"gno.land/p/demo/subpkg1"
)
`,
Expand All @@ -320,7 +320,7 @@ func TestGetGnoImports(t *testing.T) {
name: filepath.Join("subtmp", "file2.gno"),
data: `
package subtmp
import (
"gno.land/p/demo/subpkg1"
"gno.land/p/demo/subpkg2"
Expand Down
Loading

0 comments on commit dc6eb7d

Please sign in to comment.