Giter VIP home page Giter VIP logo

Comments (6)

jdkato avatar jdkato commented on May 26, 2024 2

However the way I'd solve this (and probably will if I adopt any of the packages in my project) is by adding the package to the version control. I don't know how syncing in vale works but if there isn't a way to pin versions of packages you could get a different version of a package for your runs which could break the workflow (it's probably unlikely to happen in practice but could still happen). Another potential problem is that users could have a different version of packages locally leading to inconsistencies with CI. From what I've seen Google package is ~140Kb of mostly yaml files which IMO is fine to store in the repo.

You can choose to pin to a specific release version or use the latest which (in theory) only changes with the upstream style guide you've chosen to follow.

In any case, I think your example of running a sync step is the solution here. Here's what I'd use:

repos:
  - repo: https://github.com/errata-ai/vale
    rev: 16d3a7f
    hooks:
      - id: vale
        name: vale sync
        pass_filenames: false
        args: [sync]
      - id: vale
        args: [--output=line, --minAlertLevel=error]

from vale.

AleksaC avatar AleksaC commented on May 26, 2024 1

As a contributor of the pre-commit hooks for this project I thought I'd chime in here.

Go install shouldn't be a problem for exactly the opposite reason @Jarmos-san mentioned. pre-commit caches it's environment by default and works best if you set up a cache in CI as well.

As for your problem @Jarmos-san there are many ways to solve it by adding a sync step before running pre-commit. You can use something like this:

repos:
  - repo: https://github.com/errata-ai/vale
    rev: 16d3a7f
    hooks:
      - id: vale
        name: vale sync
        pass_filenames: false
        args: [sync]
      - id: vale

However the way I'd solve this (and probably will if I adopt any of the packages in my project) is by adding the package to the version control. I don't know how syncing in vale works but if there isn't a way to pin versions of packages you could get a different version of a package for your runs which could break the workflow (it's probably unlikely to happen in practice but could still happen). Another potential problem is that users could have a different version of packages locally leading to inconsistencies with CI. From what I've seen Google package is ~140Kb of mostly yaml files which IMO is fine to store in the repo.

from vale.

jdkato avatar jdkato commented on May 26, 2024

I think a more reasonable solution here might be to switch to language: script and perform the set up in a bash script. All you really need is vale sync && vale ..., right? I imagine this would be noticeably better performance-wise than running go install ./... every time, too.

You could probably pretty easily do this in your own repo with repo: local.

from vale.

Jarmos-san avatar Jarmos-san commented on May 26, 2024

Well sure that's one workaround but it would be better to have a more fool-proof native solution for this concern.

As for the performance concerns while running go install ... shouldn't be a problem since the CI environment is supposed to be clean & its environment built up from scratch each time.

from vale.

Jarmos-san avatar Jarmos-san commented on May 26, 2024

@AleksaC great! Thanks for the suggestions, it works as we expect it to (on our local dev environments). But it fails in CI because rst2html doesn't exists in that environment.

from vale.

AleksaC avatar AleksaC commented on May 26, 2024

From what I can see in the docs seems like you need to install either sphinx or docutils globally.

from vale.

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.