Comments (3)
pulling logic out of main()
would certainly make things easier to test as well, so I'm supportive in theory.
That said, I'd want to be very deliberate about what API surface we're exposing. I've been somewhat fast and loose with some of the refactors I've done in the past because it was all internal anyway. That wouldn't be the case here. One way to guard against that is to keep the exported API as bare minimum as possible. Is it really necessary to export all of those methods? I'm not sure.
/cc @mco-gh directly for opinions
from addlicense.
I'm not opposed to this proposal but don't have much in the way of cycles these days for this project so I may not have time to review any large PRs but if you're ok with it Will, then I'm fine too.
from addlicense.
That said, I'd want to be very deliberate about what API surface we're exposing.
I'm 100% on board with that. To better inform the discussion, I pushed some potential changes into draft PR #124. I took your advice and stuck to exporting the bare minimum, which at this point is just a Run
function. I purposely did some things like leaving the deprecated skipExtensionFlags
option in main
, passing only a ignorePatterns
argument instead.
I also explored some options like passing a *log.Logger
interface around instead of calling log
functions directly. There's still work to be done as far as figuring out how to handle the fact that checkonly
calls OS.exit(1)
, etc.
It's rough around the edges, but I'd love to use it as a stepping stone for further discussion. Thank you both for being so open to considering a refactor!
from addlicense.
Related Issues (20)
- use GoReleaser to build and push container images HOT 6
- use go-enry to identify generated, vendored and other types of code
- Ignore subdirectories pattern HOT 9
- Support adding license header in .txt, .patch and .tmpl files HOT 5
- Ignore doesn't work without equals sign HOT 2
- Using `//` comments for C++ header files
- malformed module path "io/fs" HOT 2
- Intermittent failure
- Include basic example of running for the first time. HOT 1
- Can a new tag be added? HOT 1
- Introduce a flag to prefer `//` over `/*...*/` HOT 1
- Copyright line should append after the SPDX identifier HOT 3
- An extra whitespace indentation for the Apache License template
- Recursive check pattern HOT 1
- (Provide option to) ignore empty files
- Feature Request: Add a version subcommand HOT 1
- Bug: Files generated by stringer are skipped HOT 4
- How to install? `go get` is deprecated
- provide fail-on-diff flag to enable checking licence headers HOT 5
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from addlicense.