Comments (6)
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.
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.
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.
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.
@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.
From what I can see in the docs seems like you need to install either sphinx or docutils globally.
from vale.
Related Issues (20)
- Cannot get IgnoredClasses to work HOT 1
- Feature Request: Expand the list of supported scopes
- Existence with tokens seems to fail at catching angle brackets in raw scope HOT 1
- Multiple `raw` Tokens Break Rule HOT 1
- Beginning/End of Line Does Not Work in Regex Patterns HOT 1
- Hyphenated words in exceptions list still being flagged as errors HOT 3
- [Question] Is Vale's scope-awareness able to tell me under which scope a style-check has been found? HOT 1
- Support the Typst typesetting language
- Support for neorg
- Support SARIF output HOT 1
- Pulling `Vocab.zip` using `vale sync` removes all existing folders in my projects `styles/Vocab` HOT 2
- Rule that worked in 2.23 does not work in 2.27 HOT 1
- [Question] Vale Not Detecting Underscores ('_') in Token HOT 2
- Vale incorrectly detects issues inside <pre> tag ONLY if token first appears outside of <pre> tag HOT 3
- Vale counts words per sentence wrong, if one word contains a dot. This triggers 'try to keep sentence short (<30 words)' warning. HOT 5
- Question: how to ignore all words with underscores HOT 1
- Markdown: Link in image markup is linted HOT 3
- "Node.js" should not be rejected HOT 3
- Ignore MyST syntax labels HOT 4
- Release as NPM package HOT 1
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 vale.