Skip to content

Commit 6a502dd

Browse files
authored
Minor code fix
1 parent 8096f47 commit 6a502dd

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

sort.py

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -29,10 +29,10 @@ def sort_blocks():
2929

3030
# Sorting the libraries
3131
inner_blocks = sorted(blocks[0].split('##'))
32-
for i in range(1 , len(inner_blocks)):
32+
for i in range(1, len(inner_blocks)):
3333
if inner_blocks[i][0] != '#':
3434
inner_blocks[i] = '##' + inner_blocks[i]
35-
inner_blocks=''.join(inner_blocks)
35+
inner_blocks = ''.join(inner_blocks)
3636

3737
# Replacing the non-sorted libraries by the sorted ones and gathering all at the final_README file
3838
blocks[0] = inner_blocks
@@ -68,7 +68,9 @@ def main():
6868

6969
with open('README.md', 'w+') as sorted_file:
7070
# Then all of the blocks are sorted individually
71-
blocks = [''.join(sorted(block, key=lambda s: s.lower())) for block in blocks]
71+
blocks = [
72+
''.join(sorted(block, key=str.lower)) for block in blocks
73+
]
7274
# And the result is written back to README.md
7375
sorted_file.write(''.join(blocks))
7476

0 commit comments

Comments
 (0)