Skip to content

Commit

Permalink
Add more checks to vale configuration.
Browse files Browse the repository at this point in the history
  • Loading branch information
alunduil committed Mar 27, 2024
1 parent c088adf commit 3ed3527
Show file tree
Hide file tree
Showing 147 changed files with 9,952 additions and 106 deletions.
12 changes: 4 additions & 8 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -85,20 +85,16 @@ repos:
- id: check
args:
- --detailed
- repo: local
- repo: https://github.com/errata-ai/vale
rev: v3.3.1
hooks:
- id: vale
name: vale
entry: vale
language: python
exclude: ^(LICENSE|.gitignore|.envrc|styles/.*)$
types: [file, text]
exclude: '^(styles/|LICENSE$|\.envrc$)'
exclude_types:
- gitignore
- ini
- json
- nix
- python
- toml
- yaml
additional_dependencies:
- vale
12 changes: 10 additions & 2 deletions .vale.ini
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,16 @@ StylesPath = styles

MinAlertLevel = suggestion

Packages = Google
Packages = Google, Microsoft, write-good, proselint, alex, RedHat
Vocab = ZFS

[*]
BasedOnStyles = Vale, Google
BasedOnStyles = Vale, Google, Microsoft, write-good, proselint, alex, RedHat

Google.Acronyms = NO
Google.Headings = NO
Google.Parens = NO
Microsoft.Acronyms = NO
Microsoft.Headings = NO
RedHat.Contractions = NO
write-good.E-Prime = NO
2 changes: 1 addition & 1 deletion CODE_OF_CONDUCT.md
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ it deems appropriate to the circumstances. The project team is obligated to
maintain confidentiality with regard to the reporter of an incident. Further
details of specific enforcement policies may be posted separately.

Project maintainers who do not follow or enforce the Code of Conduct in good
Project maintainers who don't follow or enforce the Code of Conduct in good
faith may face temporary or permanent repercussions as determined by other
members of the project's leadership.

Expand Down
29 changes: 14 additions & 15 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,17 +2,16 @@

## Introduction

Thanks for considering contributing to zfs-replicate. Contributors are
instrumental for ensuring zfs-replicate remains easy to use and functioning
correctly.
Thanks for considering contributing to zfs-replicate. Contributors ensure
zfs-replicate continues to be usable and functional.

Following these guidelines ensures everyone is working with consistent
expectations. Repository owners and contributors are busy people and want to
ensure respectful interactions that push this project to improve.

Owners are open to pretty much any contributions you want to submit as a pull request
or issue to this repository. This community doesn't have other communication channels at
this time so feel free to use issues to report problems or ask for assistance.
this time so feel free to use issues to report problems or ask for help.

## Ground rules

Expand All @@ -29,7 +28,7 @@ See [Code of Conduct](./CODE_OF_CONDUCT.md) for more.
If you're unsure of what to contribute, view the list of "[good first
issues]."

If you're completely new to GitHub and Open Source, view:
If you're new to GitHub and Open Source, view:

* [How to Contribute to an Open Source Project on GitHub]
* [Make a Pull Request]
Expand All @@ -41,8 +40,8 @@ issue.
## Getting started

1. Create your own fork of zfs-replicate
1. If not using VS Code, run `poetry install`
1. If not using VS Code, run `poetry shell`
1. If not using Visual Studio Code, run `poetry install`
1. If not using Visual Studio Code, run `poetry shell`
1. Run `pre-commit install` in your local checkout
1. Make the changes in your fork
1. Test your changes with `pytest`
Expand All @@ -55,7 +54,7 @@ tests locally. Tests are double checked in the pull request automatically.
Small change examples:

* Spelling or grammar fixes
* Typo corrections, white space, and formatting changes
* Typographical error corrections, space, and formatting changes
* Comment clean ups

## How to report a bug
Expand All @@ -64,28 +63,28 @@ When creating an issue for a bug or unexpected behaviour, make sure you include
the following information:

1. A link to a paste with your `poetry.lock` file if available
1. A link to a paste with your `/etc/os-release` file (or equivalent for Mac or
1. A link to a paste with your `/etc/os-release` file (or similar for Mac or
Windows)
1. What command did you run? _Remove passwords or secrets if present_
1. What happened?
1. What did you expect to happen?

## How to suggest a feature or enhancement

zfs-replicate aims to be a simple to use wrapper around the ssh and `zfs` command
zfs-replicate aims to be an uncomplicated to use wrapper around SSH and `zfs` command
line tools. Other tools exist that fill more complicated use cases.

To request a new feature or ask if a feature fits the preceding philosophy, open an
issue describing the behaviour you desire and why it would be useful to you or
To request a new feature, open an
issue describing the behaviour you want and why it would be useful to you or
others. If you can, include specific examples of command invocations and side
effects to ensure owners understand the request correctly.
effects to ensure owners understand the request.

## Code review process

The owners regularly review pull requests (_if the stale issue actions comments,
The owners review pull requests (_if the stale issue actions comments,
feel free to comment asking for an estimate_). Once an owner has accepted a pull
request they merge it if all status checks pass. If you have an
interest in being an owner of this project, simply ask.
interest in being an owner of this project, ask.

## Community

Expand Down
22 changes: 11 additions & 11 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,31 +1,31 @@
<!-- vale Google.Headings = NO -->
<!-- vale RedHat.Headings = NO -->
# zfs-replicate
<!-- vale Google.Headings = YES -->
<!-- vale RedHat.Headings = YES -->

<https://github.com/alunduil/zfs-replicate>

By Alex Brandt <[email protected]>

## Description

zfs-replicate sends all Zettabyte File System (ZFS) snapshots to a remote host via SSH. zfs-replicate
zfs-replicate sends all Zettabyte File System (ZFS) snapshots to a remote host by SSH. zfs-replicate
does **not** create ZFS snapshots.

zfs-replicate forks [autorepl.py] used by [FreeNAS].
zfs-replicate forks [autorepl.py] used by [`FreeNAS`].

zfs-replicate relates to several other projects which fit other niches:
zfs-replicate relates to several other projects, which fit other niches:

1. [sanoid]: A full snapshot management system. Its companion,
`syncoid`, handles replication with many available options.
1. [zfs-replicate (BASH)]: A very similar project. The major differences are
`syncoid`, handles replication with copious options.
1. [zfs-replicate (BASH)]: A similar project. The major differences include
configuration style and system expectations (for example, logging controls).
zfs-replicate uses parameters whereas zfs-replicate (BASH) uses a BASH script.
1. [znapzend]: Another scheduling and replicating system.
1. [zrep]: A SH script with several control commands for snapshot replication.

## Terms of use

You are free to copy, modify, and distribute zfs-replicate with attribution
You are free to copy, change, and distribute zfs-replicate with attribution
under the terms of the `BSD-2-Clause` licence. See the [LICENSE] for details.

## Prerequisites
Expand Down Expand Up @@ -69,9 +69,9 @@ _N.B., don't use the root user to access your remote system._
tools and their uses.
* [Working With Oracle Solaris ZFS Snapshots and Clones]: Oracle's guide to
working with ZFS snapshots.
<!-- vale Google.Acronyms = NO -->
<!-- vale RedHat.Definitions = NO -->
* [ZFS REMOTE REPLICATION SCRIPT WITH REPORTING]
<!-- vale Google.Acronyms = YES -->
<!-- vale RedHat.Definitions = YES -->
* [ZFS replication without using Root user]: How to configure ZFS replication
for a non-root user.

Expand All @@ -81,7 +81,7 @@ _N.B., don't use the root user to access your remote system._

[autorepl.py]: https://github.com/freenas/freenas/blob/master/gui/tools/autorepl.py
[FreeBSD]: https://www.freebsd.org/
[FreeNAS]: http://www.freenas.org/
[`FreeNAS`]: http://www.freenas.org/
[GitHub issues]: https://github.com/alunduil/zfs-replicate/issues
[LICENSE]: ./LICENSE
[sanoid]: https://github.com/jimsalterjrs/sanoid
Expand Down
6 changes: 3 additions & 3 deletions styles/Google/EmDash.yml
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
extends: existence
message: "Don't put a space before or after a dash."
link: 'https://developers.google.com/style/dashes'
link: "https://developers.google.com/style/dashes"
nonword: true
level: error
action:
name: edit
params:
- remove
- ' '
- trim
- " "
tokens:
- '\s[—–]\s'
13 changes: 0 additions & 13 deletions styles/Google/EnDash.yml

This file was deleted.

7 changes: 5 additions & 2 deletions styles/Google/Exclamation.yml
Original file line number Diff line number Diff line change
@@ -1,9 +1,12 @@
extends: existence
message: "Don't use exclamation points in text."
link: 'https://developers.google.com/style/exclamation-points'
link: "https://developers.google.com/style/exclamation-points"
nonword: true
level: error
action:
name: remove
name: edit
params:
- trim_right
- "!"
tokens:
- '\w+!(?:\s|$)'
76 changes: 36 additions & 40 deletions styles/Google/GenderBias.yml
Original file line number Diff line number Diff line change
@@ -1,47 +1,43 @@
extends: substitution
message: "Consider using '%s' instead of '%s'."
link: 'https://developers.google.com/style/inclusive-documentation'
ignorecase: true
link: "https://developers.google.com/style/inclusive-documentation"
level: error
action:
name: replace
swap:
(?:alumna|alumnus): graduate
(?:alumnae|alumni): graduates
air(?:m[ae]n|wom[ae]n): pilot(s)
anchor(?:m[ae]n|wom[ae]n): anchor(s)
authoress: author
camera(?:m[ae]n|wom[ae]n): camera operator(s)
chair(?:m[ae]n|wom[ae]n): chair(s)
congress(?:m[ae]n|wom[ae]n): member(s) of congress
door(?:m[ae]|wom[ae]n): concierge(s)
draft(?:m[ae]n|wom[ae]n): drafter(s)
fire(?:m[ae]n|wom[ae]n): firefighter(s)
fisher(?:m[ae]n|wom[ae]n): fisher(s)
fresh(?:m[ae]n|wom[ae]n): first-year student(s)
garbage(?:m[ae]n|wom[ae]n): waste collector(s)
lady lawyer: lawyer
ladylike: courteous
landlord: building manager
mail(?:m[ae]n|wom[ae]n): mail carriers
man and wife: husband and wife
man enough: strong enough
mankind: human kind
manmade: manufactured
manpower: personnel
men and girls: men and women
middle(?:m[ae]n|wom[ae]n): intermediary
news(?:m[ae]n|wom[ae]n): journalist(s)
ombuds(?:man|woman): ombuds
oneupmanship: upstaging
poetess: poet
police(?:m[ae]n|wom[ae]n): police officer(s)
repair(?:m[ae]n|wom[ae]n): technician(s)
sales(?:m[ae]n|wom[ae]n): salesperson or sales people
service(?:m[ae]n|wom[ae]n): soldier(s)
steward(?:ess)?: flight attendant
tribes(?:m[ae]n|wom[ae]n): tribe member(s)
waitress: waiter
woman doctor: doctor
woman scientist[s]?: scientist(s)
work(?:m[ae]n|wom[ae]n): worker(s)
(?:alumna|alumnus): graduate
(?:alumnae|alumni): graduates
air(?:m[ae]n|wom[ae]n): pilot(s)
anchor(?:m[ae]n|wom[ae]n): anchor(s)
authoress: author
camera(?:m[ae]n|wom[ae]n): camera operator(s)
door(?:m[ae]|wom[ae]n): concierge(s)
draft(?:m[ae]n|wom[ae]n): drafter(s)
fire(?:m[ae]n|wom[ae]n): firefighter(s)
fisher(?:m[ae]n|wom[ae]n): fisher(s)
fresh(?:m[ae]n|wom[ae]n): first-year student(s)
garbage(?:m[ae]n|wom[ae]n): waste collector(s)
lady lawyer: lawyer
ladylike: courteous
mail(?:m[ae]n|wom[ae]n): mail carriers
man and wife: husband and wife
man enough: strong enough
mankind: human kind|humanity
manmade: manufactured
manpower: personnel
middle(?:m[ae]n|wom[ae]n): intermediary
news(?:m[ae]n|wom[ae]n): journalist(s)
ombuds(?:man|woman): ombuds
oneupmanship: upstaging
poetess: poet
police(?:m[ae]n|wom[ae]n): police officer(s)
repair(?:m[ae]n|wom[ae]n): technician(s)
sales(?:m[ae]n|wom[ae]n): salesperson or sales people
service(?:m[ae]n|wom[ae]n): soldier(s)
steward(?:ess)?: flight attendant
tribes(?:m[ae]n|wom[ae]n): tribe member(s)
waitress: waiter
woman doctor: doctor
woman scientist[s]?: scientist(s)
work(?:m[ae]n|wom[ae]n): worker(s)
6 changes: 3 additions & 3 deletions styles/Google/HeadingPunctuation.yml
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
extends: existence
message: "Don't put a period at the end of a heading."
link: 'https://developers.google.com/style/capitalization#capitalization-in-titles-and-headings'
link: "https://developers.google.com/style/capitalization#capitalization-in-titles-and-headings"
nonword: true
level: warning
scope: heading
action:
name: edit
params:
- remove
- '.'
- trim_right
- "."
tokens:
- '[a-z0-9][.]\s*$'
1 change: 1 addition & 0 deletions styles/Google/Headings.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,3 +26,4 @@ exceptions:
- Visual
- VS
- Windows
- JSON
10 changes: 5 additions & 5 deletions styles/Google/LyHyphens.yml
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
extends: existence
message: "'%s' doesn't need a hyphen."
link: 'https://developers.google.com/style/hyphens'
link: "https://developers.google.com/style/hyphens"
level: error
ignorecase: false
nonword: true
action:
name: edit
params:
- replace
- '-'
- ' '
- regex
- "-"
- " "
tokens:
- '\s[^\s-]+ly-'
- '\b[^\s-]+ly-\w+\b'
6 changes: 3 additions & 3 deletions styles/Google/OptionalPlurals.yml
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
extends: existence
message: "Don't use plurals in parentheses such as in '%s'."
link: 'https://developers.google.com/style/plurals-parentheses'
link: "https://developers.google.com/style/plurals-parentheses"
level: error
nonword: true
action:
name: edit
params:
- remove
- '(s)'
- trim_right
- "(s)"
tokens:
- '\b\w+\(s\)'
9 changes: 9 additions & 0 deletions styles/Microsoft/AMPM.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
extends: existence
message: Use 'AM' or 'PM' (preceded by a space).
link: https://docs.microsoft.com/en-us/style-guide/a-z-word-list-term-collections/term-collections/date-time-terms
level: error
nonword: true
tokens:
- '\d{1,2}[AP]M'
- '\d{1,2} ?[ap]m'
- '\d{1,2} ?[aApP]\.[mM]\.'
Loading

0 comments on commit 3ed3527

Please sign in to comment.