-
Notifications
You must be signed in to change notification settings - Fork 7
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
docs: update README with
atlas --help
(#28)
This helps engineers to understand the project at a glance. This contribution is part of the [FC-0012 project](https://openedx.atlassian.net/l/cp/XGS0iCcQ) which is sparked by the [Translation Infrastructure update OEP-58](https://open-edx-proposals.readthedocs.io/en/latest/architectural-decisions/oep-0058-arch-translations-management.html#specification).
- Loading branch information
1 parent
18eb0cc
commit c68169c
Showing
6 changed files
with
163 additions
and
53 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -31,7 +31,7 @@ pip-log.txt | |
.tox | ||
coverage.xml | ||
htmlcov/ | ||
|
||
README.rst.backup | ||
|
||
|
||
# The Silver Searcher | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
""" | ||
Updates the `atlas --help` section of the README.rst file. | ||
""" | ||
|
||
import re | ||
import subprocess | ||
import textwrap # Available in Python 3.3+ | ||
|
||
|
||
with open('README.rst', encoding='utf-8') as readme_file_r: | ||
readme = readme_file_r.read() | ||
help_message = subprocess.check_output(['./atlas', '--help']).decode('utf-8') | ||
help_message_indented = textwrap.indent(help_message, ' ') # Ensure it appears as a code-block in the README | ||
|
||
updated_readme = re.sub( | ||
r' {4}Atlas is a CLI tool that has essentially.*Running Automated Tests Locally', | ||
'{msg}\nRunning Automated Tests Locally'.format(msg=help_message_indented), | ||
readme, | ||
flags=re.DOTALL, | ||
) | ||
|
||
with open('README.rst', 'w', encoding='utf-8') as readme_file_w: | ||
readme_file_w.write(updated_readme) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
# requires getoptions to be installed | ||
# installing getoptions locally: https://github.com/ko1nksm/getoptions/#installation | ||
verify_help_section() { | ||
cp README.rst README.rst.backup | ||
make -s atlas_help_to_readme | ||
diff --report-identical-files README.rst README.rst.backup | ||
rm README.rst | ||
mv README.rst.backup README.rst | ||
} | ||
|
||
Describe 'atlas help section' | ||
It 'has run "make atlas_help_to_readme"' | ||
When call verify_help_section | ||
The output should equal "Files README.rst and README.rst.backup are identical" | ||
End | ||
End |