Refactor: apply new internal structurs #206

Merged
lunny merged 22 commits from 6543/tea:refactor_new-internal-structure into master 2020-09-30 05:11:35 +00:00
Owner

reference: #184

Aim:

  • restructure but do not change any function
  • make it more or less compliant with proposed struct

No-Aim:

  • simplify things based on new structure (i.g. addLoginToConfig & AddLogin)
  • remove redundant code (if it will need some changes to routines ...)

Refactors:

  • Move Config & Login routines into config package
  • Rename global flag var in cmd and move into flag package
  • Move help func to utils
  • Move DetailViews stdout print func to print package
  • Move Interactive Login Creation to interact package
  • Move (split) subcomands into own sourcefiles
  • Move Subcomands sourcefiles into it's own Packages
  • Move print TrackedTimesList to print package
reference: #184 ### Aim: * restructure but do not change any function * make it more or less compliant with proposed struct ### No-Aim: * simplify things based on new structure (i.g. addLoginToConfig & AddLogin) * remove redundant code (if it will need some changes to routines ...) ### Refactors: * Move Config & Login routines into config package * Rename global flag var in cmd and move into flag package * Move help func to utils * Move DetailViews stdout print func to print package * Move Interactive Login Creation to interact package * Move (split) subcomands into own sourcefiles * Move Subcomands sourcefiles into it's own Packages * Move print TrackedTimesList to print package
6543 added 3 commits 2020-09-27 22:33:57 +00:00
* Move Config & Login routines into intern package
* rename global var in cmd
* Move help func to utils
smal nits
Some checks failed
continuous-integration/drone/pr Build is failing
27360dd555
6543 changed title from Refactor: apply new internal structurs to WIP: Refactor: apply new internal structurs 2020-09-27 22:34:09 +00:00
6543 added the
status/wip
kind
refactor
labels 2020-09-27 22:34:21 +00:00
6543 added this to the v0.6.0 milestone 2020-09-27 22:34:25 +00:00
6543 added 1 commit 2020-09-27 23:15:11 +00:00
lint: add description to exported func
All checks were successful
continuous-integration/drone/pr Build is passing
84f02526c4
6543 reviewed 2020-09-27 23:21:12 +00:00
Dismissed
@ -0,0 +1,153 @@
// Copyright 2018 The Gitea Authors. All rights reserved.
Author
Owner

2020

2020
6543 marked this conversation as resolved
@ -0,0 +19,4 @@
"gopkg.in/yaml.v2"
)
// Config reprensents local configurations
Author
Owner

LocalConfig

LocalConfig
6543 marked this conversation as resolved
@ -0,0 +29,4 @@
yamlConfigPath string
)
func init() {
Author
Owner

// TODO: dont rely on intransparent init func to detect tea config

// TODO: dont rely on intransparent init func to detect tea config
6543 marked this conversation as resolved
6543 added 1 commit 2020-09-27 23:24:38 +00:00
apply from review
Some checks failed
continuous-integration/drone/pr Build is failing
c9877bafd5
6543 force-pushed refactor_new-internal-structure from c9877bafd5 to c0aa819442 2020-09-27 23:26:04 +00:00 Compare
6543 added 2 commits 2020-09-27 23:44:51 +00:00
6543 added 9 commits 2020-09-28 00:43:30 +00:00
6543 added
status/needs-reviews
and removed
status/wip
labels 2020-09-28 00:48:24 +00:00
6543 changed title from WIP: Refactor: apply new internal structurs to Refactor: apply new internal structurs 2020-09-28 00:48:33 +00:00
Author
Owner

OK this already to that big - so wont add more to this and wait until it got merged to send the next batch (shouldn't be that big but will contain impruvements ... (see TODOs)

OK this already to that big - so wont add more to this and wait until it got merged to send the next batch (shouldn't be that big but will contain impruvements ... (see TODOs)
lunny reviewed 2020-09-28 02:37:05 +00:00
Dismissed
cmd/issues.go Outdated
@ -9,2 +8,3 @@
"log"
"strconv"
"code.gitea.io/tea/modules/intern"
Owner

We need a blank line.

We need a blank line.
Author
Owner

between internal modues ?!?

between internal modues ?!?
6543 marked this conversation as resolved
Owner

How about a subfolder for issues' commands?

How about a subfolder for issues' commands?
Author
Owner

How about a subfolder for issues' commands?

what structur do you mean?

instead of issues_subcomand -> issues/subcomand ?

> How about a subfolder for issues' commands? what structur do you mean? instead of issues_subcomand -> issues/subcomand ?
noerw requested changes 2020-09-29 10:09:29 +00:00
Dismissed
noerw left a comment
Member

I didn't do a thorough review yet, but generally it looks like a great improvement ?
Some remarks:

  1. modules/intern -> modules/internal (intern means Praktikant and isn't that much shorter ;)
  • even more descriptive would be modules/config, because it is all about config right now?
  1. move modules/git/auth.go:absPathWithExpansion to modules/util/path.go?
  2. move cmd/times.go:formatDuration() to modules/print/print.go?
  3. modules/interact seems a bit too separated, unless you expect that module to grow significantly?
I didn't do a thorough review yet, but generally it looks like a great improvement ? Some remarks: 1. `modules/intern` -> `modules/internal` (intern means Praktikant and isn't that much shorter ;) - even more descriptive would be `modules/config`, because it is all about config right now? 2. move `modules/git/auth.go:absPathWithExpansion` to `modules/util/path.go`? 3. move `cmd/times.go:formatDuration()` to `modules/print/print.go`? 4. `modules/interact` seems a bit too separated, unless you expect that module to grow significantly?
6543 added 1 commit 2020-09-29 10:18:39 +00:00
Move Subcomands into it's own Packages
All checks were successful
continuous-integration/drone/pr Build is passing
601bcbfa96
Author
Owner
  • 1. internal is a preserved package name (we can't use that one...)
    • I think we can go the "config" way :)
  • 4. yes I think so :) (I like to have more interaction for create comands with no args)
  • 2. &3. I'll look into it
* `1.` `internal` is a preserved package name (we can't use that one...) * I think we can go the "config" way :) * `4.` yes I think so :) (I like to have more interaction for `create` comands with no args) * `2. &3.` I'll look into it
6543 added 1 commit 2020-09-29 11:16:30 +00:00
rename module intern to config
All checks were successful
continuous-integration/drone/pr Build is passing
b96f1eeb9c
6543 added 2 commits 2020-09-29 11:27:31 +00:00
Author
Owner

@noerw done
@lunny done

@noerw done @lunny done
Owner

Lint error

Lint error
6543 added 1 commit 2020-09-29 11:37:31 +00:00
fix lint
All checks were successful
continuous-integration/drone/pr Build is passing
6882d61a31
Author
Owner

@lunny fixed :)

@lunny fixed :)
6543 reviewed 2020-09-29 11:54:23 +00:00
Dismissed
@ -0,0 +6,4 @@
import (
"code.gitea.io/sdk/gitea"
"code.gitea.io/tea/cmd/flags"
Author
Owner

sort import

sort import
6543 marked this conversation as resolved
@ -0,0 +1,26 @@
// Copyright 2018 The Gitea Authors. All rights reserved.
Author
Owner

year

year
6543 marked this conversation as resolved
6543 added 1 commit 2020-09-29 11:55:29 +00:00
fix lint
All checks were successful
continuous-integration/drone/pr Build is passing
4d2da14318
6543 removed the
status/needs-reviews
label 2020-09-29 11:56:57 +00:00
6543 requested review from lunny 2020-09-29 11:57:09 +00:00
noerw approved these changes 2020-09-29 16:01:31 +00:00
Dismissed
Author
Owner

@lunny do you have time?

@lunny do you have time?
lunny approved these changes 2020-09-30 05:11:23 +00:00
Dismissed
lunny merged commit f445ac7521 into master 2020-09-30 05:11:35 +00:00
6543 deleted branch refactor_new-internal-structure 2020-09-30 06:35:52 +00:00
Sign in to join this conversation.
No description provided.