Skip to content

Commit 59c545e

Browse files
committed
Update
1 parent a424a1a commit 59c545e

File tree

1 file changed

+12
-15
lines changed

1 file changed

+12
-15
lines changed

.github/workflows/spelling.yml

Lines changed: 12 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -120,22 +120,19 @@ jobs:
120120
121121
with open('.pyspelling.yml', 'r') as f:
122122
config = yaml.safe_load(f)
123-
124-
# Modify only the sources in each matrix entry
123+
124+
new_matrix = []
125125
for matrix in config['matrix']:
126-
matrix['sources'] = ['$file']
127-
126+
d # Check if the file extension matches the matrix name
127+
if (('python' in matrix['name'].lower() and '$file'.endswith('.py')) or
128+
('rest' in matrix['name'].lower() and '$file'.endswith('.rst')) or
129+
('markdown' in matrix['name'].lower() and '$file'.endswith('.md'))):
130+
matrix_copy = matrix.copy()
131+
matrix_copy['sources'] = ['$file']
132+
new_matrix.append(matrix_copy)
133+
134+
config['matrix'] = new_matrix
135+
128136
with open('temp_config.yml', 'w') as f:
129137
yaml.dump(config, f, default_flow_style=False)
130138
EOF
131-
132-
if ! pyspelling -c temp_config.yml; then
133-
FINAL_EXIT_CODE=1
134-
fi
135-
fi
136-
done
137-
138-
if [ $FINAL_EXIT_CODE -ne 0 ]; then
139-
echo "Spell check failed!"
140-
exit 1
141-
fi

0 commit comments

Comments
 (0)