Skip to content

Commit f42ace4

Browse files
committed
Add another action
1 parent 1b3a9d2 commit f42ace4

File tree

4 files changed

+44
-38
lines changed

4 files changed

+44
-38
lines changed

Microsoft/GenderBias.yml

+40-38
Original file line numberDiff line numberDiff line change
@@ -2,43 +2,45 @@ extends: substitution
22
message: "Consider using '%s' instead of '%s'."
33
ignorecase: true
44
level: error
5+
action:
6+
name: replace
57
swap:
6-
(?:alumna|alumnus): graduate
7-
(?:alumnae|alumni): graduates
8-
air(?:m[ae]n|wom[ae]n): pilot(s)
9-
anchor(?:m[ae]n|wom[ae]n): anchor(s)
10-
authoress: author
11-
camera(?:m[ae]n|wom[ae]n): camera operator(s)
12-
chair(?:m[ae]n|wom[ae]n): chair(s)
8+
(?:alumna|alumnus): graduate
9+
(?:alumnae|alumni): graduates
10+
air(?:m[ae]n|wom[ae]n): pilot(s)
11+
anchor(?:m[ae]n|wom[ae]n): anchor(s)
12+
authoress: author
13+
camera(?:m[ae]n|wom[ae]n): camera operator(s)
14+
chair(?:m[ae]n|wom[ae]n): chair(s)
1315
congress(?:m[ae]n|wom[ae]n): member(s) of congress
14-
door(?:m[ae]|wom[ae]n): concierge(s)
15-
draft(?:m[ae]n|wom[ae]n): drafter(s)
16-
fire(?:m[ae]n|wom[ae]n): firefighter(s)
17-
fisher(?:m[ae]n|wom[ae]n): fisher(s)
18-
fresh(?:m[ae]n|wom[ae]n): first-year student(s)
19-
garbage(?:m[ae]n|wom[ae]n): waste collector(s)
20-
lady lawyer: lawyer
21-
ladylike: courteous
22-
landlord: building manager
23-
mail(?:m[ae]n|wom[ae]n): mail carriers
24-
man and wife: husband and wife
25-
man enough: strong enough
26-
mankind: human kind
27-
manmade: manufactured
28-
manpower: personnel
29-
men and girls: men and women
30-
middle(?:m[ae]n|wom[ae]n): intermediary
31-
news(?:m[ae]n|wom[ae]n): journalist(s)
32-
ombuds(?:man|woman): ombuds
33-
oneupmanship: upstaging
34-
poetess: poet
35-
police(?:m[ae]n|wom[ae]n): police officer(s)
36-
repair(?:m[ae]n|wom[ae]n): technician(s)
37-
sales(?:m[ae]n|wom[ae]n): salesperson or sales people
38-
service(?:m[ae]n|wom[ae]n): soldier(s)
39-
steward(?:ess)?: flight attendant
40-
tribes(?:m[ae]n|wom[ae]n): tribe member(s)
41-
waitress: waiter
42-
woman doctor: doctor
43-
woman scientist[s]?: scientist(s)
44-
work(?:m[ae]n|wom[ae]n): worker(s)
16+
door(?:m[ae]|wom[ae]n): concierge(s)
17+
draft(?:m[ae]n|wom[ae]n): drafter(s)
18+
fire(?:m[ae]n|wom[ae]n): firefighter(s)
19+
fisher(?:m[ae]n|wom[ae]n): fisher(s)
20+
fresh(?:m[ae]n|wom[ae]n): first-year student(s)
21+
garbage(?:m[ae]n|wom[ae]n): waste collector(s)
22+
lady lawyer: lawyer
23+
ladylike: courteous
24+
landlord: building manager
25+
mail(?:m[ae]n|wom[ae]n): mail carriers
26+
man and wife: husband and wife
27+
man enough: strong enough
28+
mankind: human kind
29+
manmade: manufactured
30+
manpower: personnel
31+
men and girls: men and women
32+
middle(?:m[ae]n|wom[ae]n): intermediary
33+
news(?:m[ae]n|wom[ae]n): journalist(s)
34+
ombuds(?:man|woman): ombuds
35+
oneupmanship: upstaging
36+
poetess: poet
37+
police(?:m[ae]n|wom[ae]n): police officer(s)
38+
repair(?:m[ae]n|wom[ae]n): technician(s)
39+
sales(?:m[ae]n|wom[ae]n): salesperson or sales people
40+
service(?:m[ae]n|wom[ae]n): soldier(s)
41+
steward(?:ess)?: flight attendant
42+
tribes(?:m[ae]n|wom[ae]n): tribe member(s)
43+
waitress: waiter
44+
woman doctor: doctor
45+
woman scientist[s]?: scientist(s)
46+
work(?:m[ae]n|wom[ae]n): worker(s)

features/rules.feature

+1
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@ Feature: Rules
2020
Then the output should contain exactly:
2121
"""
2222
test.md:3:6:Microsoft.Gender:Don't use 'he/she'.
23+
test.md:5:5:Microsoft.GenderBias:Consider using 'camera operator(s)' instead of 'cameraman'.
2324
"""
2425

2526
Scenario: Use of AM and PM

fixtures/Gender/.vale.ini

+1
Original file line numberDiff line numberDiff line change
@@ -4,3 +4,4 @@ MinAlertLevel = suggestion
44

55
[*.md]
66
Microsoft.Gender = YES
7+
Microsoft.GenderBias = YES

fixtures/Gender/test.md

+2
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
11
# Gender
22

33
When he/she clicks on the link.
4+
5+
The cameraman was here.

0 commit comments

Comments
 (0)