File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 99 build :
1010 runs-on : ubuntu-latest
1111 steps :
12- - uses : actions/checkout@v4
12+ - uses : actions/checkout@v5
1313 - uses : astral-sh/setup-uv@v6
1414 with :
1515 enable-cache : true
Original file line number Diff line number Diff line change 1212 build :
1313 runs-on : ubuntu-latest
1414 steps :
15- - uses : actions/checkout@v4
15+ - uses : actions/checkout@v5
1616 - uses : devcontainers/ci@v0.3
1717 with :
1818 push : never
Original file line number Diff line number Diff line change 66 directory_writer :
77 runs-on : ubuntu-latest
88 steps :
9- - uses : actions/checkout@v4
9+ - uses : actions/checkout@v5
1010 with :
1111 fetch-depth : 0
1212 - uses : actions/setup-python@v5
Original file line number Diff line number Diff line change 1414 project-euler :
1515 runs-on : ubuntu-latest
1616 steps :
17- - uses : actions/checkout@v4
17+ - uses : actions/checkout@v5
1818 - uses : astral-sh/setup-uv@v6
1919 - uses : actions/setup-python@v5
2020 with :
2424 validate-solutions :
2525 runs-on : ubuntu-latest
2626 steps :
27- - uses : actions/checkout@v4
27+ - uses : actions/checkout@v5
2828 - uses : astral-sh/setup-uv@v6
2929 - uses : actions/setup-python@v5
3030 with :
Original file line number Diff line number Diff line change 1111 ruff :
1212 runs-on : ubuntu-latest
1313 steps :
14- - uses : actions/checkout@v4
14+ - uses : actions/checkout@v5
1515 - uses : astral-sh/setup-uv@v6
1616 - run : uvx ruff check --output-format=github .
Original file line number Diff line number Diff line change 2525 build_docs :
2626 runs-on : ubuntu-24.04-arm
2727 steps :
28- - uses : actions/checkout@v4
28+ - uses : actions/checkout@v5
2929 - uses : astral-sh/setup-uv@v6
3030 - uses : actions/setup-python@v5
3131 with :
3434 - run : uv sync --group=docs
3535 - uses : actions/configure-pages@v5
3636 - run : uv run sphinx-build -c docs . docs/_build/html
37- - uses : actions/upload-pages-artifact@v3
37+ - uses : actions/upload-pages-artifact@v4
3838 with :
3939 path : docs/_build/html
4040
Original file line number Diff line number Diff line change 11repos :
22 - repo : https://github.com/pre-commit/pre-commit-hooks
3- rev : v5 .0.0
3+ rev : v6 .0.0
44 hooks :
55 - id : check-executables-have-shebangs
66 - id : check-toml
1616 - id : auto-walrus
1717
1818 - repo : https://github.com/astral-sh/ruff-pre-commit
19- rev : v0.12.5
19+ rev : v0.12.9
2020 hooks :
2121 - id : ruff-check
2222 - id : ruff-format
Original file line number Diff line number Diff line change 2727 <a href =" https://github.com/pre-commit/pre-commit " >
2828 <img src="https://img.shields.io/badge/pre--commit-enabled-brightgreen?logo=pre-commit&logoColor=white&style=flat-square" height="20" alt="pre-commit">
2929 </a >
30- <a href =" https://github.com/psf/black " >
31- <img src="https://img.shields.io/static/v1?label=code%20style&message=black &color=black&style=flat-square" height="20" alt="code style: black">
30+ <a href =" https://docs.astral.sh/ruff/formatter/ " >
31+ <img src="https://img.shields.io/static/v1?label=code%20style&message=ruff &color=black&style=flat-square" height="20" alt="code style: black">
3232 </a >
3333<!-- Short description: -->
3434 <h3 >All algorithms implemented in Python - for education</h3 >
Original file line number Diff line number Diff line change 1- from string import ascii_lowercase , ascii_uppercase
2-
3-
41def capitalize (sentence : str ) -> str :
52 """
63 Capitalizes the first letter of a sentence or word.
@@ -19,11 +16,9 @@ def capitalize(sentence: str) -> str:
1916 if not sentence :
2017 return ""
2118
22- # Create a dictionary that maps lowercase letters to uppercase letters
2319 # Capitalize the first character if it's a lowercase letter
2420 # Concatenate the capitalized character with the rest of the string
25- lower_to_upper = dict (zip (ascii_lowercase , ascii_uppercase ))
26- return lower_to_upper .get (sentence [0 ], sentence [0 ]) + sentence [1 :]
21+ return sentence [0 ].upper () + sentence [1 :]
2722
2823
2924if __name__ == "__main__" :
You can’t perform that action at this time.
0 commit comments