@@ -118,23 +118,23 @@ jobs:
118118 echo "Checking spelling in $file"
119119 # Create a temporary config file based on the existing one
120120 python3 - <<EOF > temp_config.yml
121- import yaml
121+ import yaml
122122
123- with open('.pyspelling.yml', 'r') as f:
124- config = yaml.safe_load(f)
123+ with open('.pyspelling.yml', 'r') as f :
124+ config = yaml.safe_load(f)
125125
126- new_matrix = []
127- for matrix in config['matrix']:
128- # Check if the file extension matches the matrix name
129- if (('python' in matrix['name'].lower() and '$file'.endswith('.py')) or
130- ('rest ' in matrix['name'].lower() and '$file'.endswith('.rst')) or
131- ('markdown' in matrix['name'].lower() and '$file'.endswith('.md'))):
132- matrix_copy = matrix.copy()
133- matrix_copy['sources'] = ['$file']
134- new_matrix.append(matrix_copy)
126+ new_matrix = []
127+ for matrix in config['matrix'] :
128+
129+ if (('python' in matrix['name'].lower() and '$file'.endswith('.py')) or
130+ ('reST ' in matrix['name'] and '$file'.endswith('.rst')) or
131+ ('markdown' in matrix['name'].lower() and '$file'.endswith('.md'))) :
132+ matrix_copy = matrix.copy()
133+ matrix_copy['sources'] = ['$file']
134+ new_matrix.append(matrix_copy)
135135
136- config['matrix'] = new_matrix
136+ config['matrix'] = new_matrix
137137
138- with open('temp_config.yml', 'w') as f:
139- yaml.dump(config, f, default_flow_style=False)
140- EOF
138+ with open('temp_config.yml', 'w') as f :
139+ yaml.dump(config, f, default_flow_style=False)
140+ EOF
0 commit comments