Refactor: apply new internal structurs #206

Merged
lunny merged 22 commits from 6543/tea:refactor_new-internal-structure into master 2 years ago
6543 commented 2 years ago
Collaborator

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 2 years ago
6bad01c328
Refactor:
continuous-integration/drone/pr Build is failing Details
27360dd555
smal nits
6543 changed title from Refactor: apply new internal structurs to WIP: Refactor: apply new internal structurs 2 years ago
6543 added the status/wip kind/refactor labels 2 years ago
6543 added this to the v0.6.0 milestone 2 years ago
6543 added 1 commit 2 years ago
continuous-integration/drone/pr Build is passing Details
84f02526c4
lint: add description to exported func
6543 reviewed 2 years ago
Dismissed
// Copyright 2018 The Gitea Authors. All rights reserved.
6543 commented 2 years ago
Poster
Collaborator

2020

2020
6543 marked this conversation as resolved
"gopkg.in/yaml.v2"
)
// Config reprensents local configurations
6543 commented 2 years ago
Poster
Collaborator

LocalConfig

LocalConfig
6543 marked this conversation as resolved
yamlConfigPath string
)
func init() {
6543 commented 2 years ago
Poster
Collaborator

// 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 2 years ago
continuous-integration/drone/pr Build is failing Details
c9877bafd5
apply from review
6543 force-pushed refactor_new-internal-structure from c9877bafd5 to c0aa819442 2 years ago
6543 added 2 commits 2 years ago
6543 added 9 commits 2 years ago
6543 added status/needs-reviews and removed status/wip labels 2 years ago
6543 changed title from WIP: Refactor: apply new internal structurs to Refactor: apply new internal structurs 2 years ago
6543 commented 2 years ago
Poster
Collaborator

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 2 years ago
Dismissed
cmd/issues.go Outdated
"log"
"strconv"
"code.gitea.io/tea/modules/intern"
lunny commented 2 years ago
Owner

We need a blank line.

We need a blank line.
6543 commented 2 years ago
Poster
Collaborator

between internal modues ?!?

between internal modues ?!?
6543 marked this conversation as resolved
lunny commented 2 years ago
Owner

How about a subfolder for issues' commands?

How about a subfolder for issues' commands?
6543 commented 2 years ago
Poster
Collaborator

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 2 years ago
Dismissed
noerw left a comment
Collaborator

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 2 years ago
continuous-integration/drone/pr Build is passing Details
601bcbfa96
Move Subcomands into it's own Packages
6543 commented 2 years ago
Poster
Collaborator
  • 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 2 years ago
continuous-integration/drone/pr Build is passing Details
b96f1eeb9c
rename module intern to config
6543 added 2 commits 2 years ago
6543 commented 2 years ago
Poster
Collaborator

@noerw done
@lunny done

@noerw done @lunny done
lunny commented 2 years ago
Owner

Lint error

Lint error
6543 added 1 commit 2 years ago
continuous-integration/drone/pr Build is passing Details
6882d61a31
fix lint
6543 commented 2 years ago
Poster
Collaborator

@lunny fixed :)

@lunny fixed :)
6543 reviewed 2 years ago
Dismissed
import (
"code.gitea.io/sdk/gitea"
"code.gitea.io/tea/cmd/flags"
6543 commented 2 years ago
Poster
Collaborator

sort import

sort import
6543 marked this conversation as resolved
// Copyright 2018 The Gitea Authors. All rights reserved.
6543 commented 2 years ago
Poster
Collaborator

year

year
6543 marked this conversation as resolved
6543 added 1 commit 2 years ago
continuous-integration/drone/pr Build is passing Details
4d2da14318
fix lint
6543 removed the status/needs-reviews label 2 years ago
6543 requested review from lunny 2 years ago
noerw approved these changes 2 years ago
Dismissed
6543 commented 2 years ago
Poster
Collaborator

@lunny do you have time?

@lunny do you have time?
lunny approved these changes 2 years ago
Dismissed
lunny merged commit f445ac7521 into master 2 years ago
6543 deleted branch refactor_new-internal-structure 2 years ago
continuous-integration/drone/pr Build is passing
The pull request has been merged as f445ac7521.
Sign in to join this conversation.
Loading…
There is no content yet.