Coder Social home page Coder Social logo

Comments (3)

nilslice avatar nilslice commented on May 30, 2024

@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.

milton0825 avatar milton0825 commented on May 30, 2024

@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.

nilslice avatar nilslice commented on May 30, 2024

Closing as #58 solves.

from protolock.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    πŸ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❀️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.