Comments (3)
@milton0825 - this is interesting, especially after taking a closer look at your closed PR. I see what you mean where the ability to do more custom "comparison" of a Protolock
from the proto.lock
(current) and the parsed set (updated) of proto files would benefit teams with more specific needs.
At first glance, it seems like this would be very difficult to support in a dynamic way (e.g. using a configuration file to enable/disable rules, or define custom ones). However, if you were to take a look at the implementation code of the CLI, it uses the nilslice/protolock
code as a library, which some parts are exposed to callers as exported funcs.
Do you think you could attempt building your own CLI that would run after protolock
but instead of directly using Status
, you would use the funcs within nilslice/protolock
as an imported package within your own separate CLI?
I assume you would need to PR some changes to this repo, where the current funcs are unexported -- I'm completely fine with exporting any of them if you need.
To demonstrate this, you could call these functions (which would need to be exported): https://github.com/nilslice/protolock/blob/master/parse.go#L305-L329 to get the "current" Protolock
(as defined in proto.lock
file)
And compare it using your own rules using the Protolock
you get from this func (also needs exporting): https://github.com/nilslice/protolock/blob/master/parse.go#L402-L452
The end result is that you would have a separate binary CLI to run after the main protolock
binary CLI in your build process, but it would allow you to make it as custom as you'd like while still using the same proto.lock
file.
Let me know if this makes sense or if there are other constraints I'm not considering.
If you end up considering this path, and are able to open source the code, I would love to link to your project from here to help others make custom rules of their own or use yours
from protolock.
@nilslice thanks for the feedback. I think we can refactor the code a bit and expose a function that takes customized rules from user and check if changes pass those rules.
from protolock.
Closing as #58 solves.
from protolock.
Related Issues (20)
- Check if lockfile is up to date HOT 6
- Commit command no longer saves the lock under certain circumstances HOT 6
- Cannot parse certain Protobuf files HOT 5
- Deterministic definition order. HOT 4
- What are the differences to Uberβs Prototool HOT 1
- use yaml for proto.lock to reduce diff HOT 6
- Plugin wiki readme json missing fields HOT 2
- Lock file does not record aggregate options with array values HOT 3
- Website incorrectly reports backwards compatibility with invalid proto files HOT 2
- Error building protolock on ppc64le HOT 2
- Processing a single file HOT 3
- Enum aliases not supported HOT 3
- Does protolock support proto2 ? HOT 1
- Propose to publish ARM64 binary in releases HOT 6
- Convert circleci jobs to GitHub Actions
- oneof structure is not persisted in protolock HOT 4
- Options not parsed at the Enum level HOT 2
- found "stream" but expected [rpc method] for a valid proto HOT 3
- Add artefacts to Maven repository HOT 5
- Update docker hub image HOT 3
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 protolock.