Skip to content

Commit d5c1efc

Browse files
committed
Update
1 parent a1daa03 commit d5c1efc

File tree

593 files changed

+331616
-21
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

593 files changed

+331616
-21
lines changed

.coveragerc

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
[report]
2+
sort = Cover
3+
omit =
4+
.env/*

.github/FUNDING.yml

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
# These are supported funding model platforms
2+
3+
github: [cclauss]
4+
patreon: cclauss
5+
open_collective: # Replace with a single Open Collective username
6+
ko_fi: # Replace with a single Ko-fi username
7+
tidelift: # Replace with a single Tidelift platform-name/package-name e.g., npm/babel
8+
community_bridge: # Replace with a single Community Bridge project-name e.g., cloud-foundry
9+
liberapay: TheAlgorithms
10+
issuehunt: # Replace with a single IssueHunt username
11+
otechie: # Replace with a single Otechie username
12+
custom: ['http://paypal.me/TheAlgorithms/1000', 'https://donorbox.org/thealgorithms']

.github/pull_request_template.md

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
### **Describe your change:**
2+
3+
4+
5+
* [ ] Add an algorithm?
6+
* [ ] Fix a bug or typo in an existing algorithm?
7+
* [ ] Documentation change?
8+
9+
### **Checklist:**
10+
* [ ] I have read [CONTRIBUTING.md](https://github.com/TheAlgorithms/Python/blob/master/CONTRIBUTING.md).
11+
* [ ] This pull request is all my own work -- I have not plagiarized.
12+
* [ ] I know that pull requests will not be merged if they fail the automated tests.
13+
* [ ] This PR only changes one algorithm file. To ease review, please open separate PRs for separate algorithms.
14+
* [ ] All new Python files are placed inside an existing directory.
15+
* [ ] All filenames are in all lowercase characters with no spaces or dashes.
16+
* [ ] All functions and variable names follow Python naming conventions.
17+
* [ ] All function parameters and return values are annotated with Python [type hints](https://docs.python.org/3/library/typing.html).
18+
* [ ] All functions have [doctests](https://docs.python.org/3/library/doctest.html) that pass the automated testing.
19+
* [ ] All new algorithms have a URL in its comments that points to Wikipedia or other similar explanation.
20+
* [ ] If this pull request resolves one or more open issues then the commit message contains `Fixes: #{$ISSUE_NO}`.

.github/stale.yml

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
# Number of days of inactivity before an issue becomes stale
2+
daysUntilStale: 30
3+
# Number of days of inactivity before a stale issue is closed
4+
daysUntilClose: 7
5+
# Issues with these labels will never be considered stale
6+
exemptLabels:
7+
- bug
8+
- help wanted
9+
- OK to merge
10+
# Label to use when marking an issue as stale
11+
staleLabel: wontfix
12+
# Comment to post when marking an issue as stale. Set to `false` to disable
13+
markComment: >
14+
This issue has been automatically marked as stale because it has not had
15+
recent activity. It will be closed if no further activity occurs. Thank you
16+
for your contributions.
17+
# Comment to post when closing a stale issue. Set to `false` to disable
18+
closeComment: true

.github/workflows/autoblack.yml

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
# GitHub Action that uses Black to reformat Python code (if needed) when doing a git push.
2+
# If all Python code in the repo is compliant with Black then this Action does nothing.
3+
# Otherwise, Black is run and its changes are committed to the repo.
4+
# https://github.com/cclauss/autoblack
5+
6+
name: autoblack_push
7+
on: [push]
8+
jobs:
9+
build:
10+
runs-on: ubuntu-latest
11+
steps:
12+
- uses: actions/checkout@v1 # Use v1, NOT v2
13+
- uses: actions/setup-python@v1
14+
- run: pip install black
15+
- run: black --check .
16+
- name: If needed, commit black changes to a new pull request
17+
if: failure()
18+
run: |
19+
black .
20+
git config --global user.name github-actions
21+
git config --global user.email '${GITHUB_ACTOR}@users.noreply.github.com'
22+
git remote set-url origin https://x-access-token:${{ secrets.GITHUB_TOKEN }}@github.com/$GITHUB_REPOSITORY
23+
git commit -am "fixup! Format Python code with psf/black push"
24+
git push --force origin HEAD:$GITHUB_REF

.github/workflows/codespell.yml

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
# GitHub Action to automate the identification of common misspellings in text files
2+
# https://github.com/codespell-project/codespell
3+
name: codespell
4+
on: [push, pull_request]
5+
jobs:
6+
codespell:
7+
runs-on: ubuntu-latest
8+
steps:
9+
- uses: actions/checkout@v2
10+
- uses: actions/setup-python@v1
11+
- run: pip install codespell flake8
12+
- run: |
13+
SKIP="./.*,./other/dictionary.txt,./other/words,./project_euler/problem_22/p022_names.txt"
14+
codespell -L ans,fo,hist,iff,secant,tim --skip=$SKIP --quiet-level=2
Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
# The objective of this GitHub Action is to update the DIRECTORY.md file (if needed)
2+
# when doing a git push
3+
name: directory_writer
4+
on: [push]
5+
jobs:
6+
build:
7+
runs-on: ubuntu-latest
8+
steps:
9+
- uses: actions/checkout@v1 # v1, NOT v2
10+
- uses: actions/setup-python@v1
11+
with:
12+
python-version: 3.x
13+
- name: Write DIRECTORY.md
14+
run: |
15+
scripts/build_directory_md.py 2>&1 | tee DIRECTORY.md
16+
git config --global user.name github-actions
17+
git config --global user.email '${GITHUB_ACTOR}@users.noreply.github.com'
18+
git remote set-url origin https://x-access-token:${{ secrets.GITHUB_TOKEN }}@github.com/$GITHUB_REPOSITORY
19+
- name: Update DIRECTORY.md
20+
run: |
21+
git add DIRECTORY.md
22+
git commit -am "updating DIRECTORY.md" || true
23+
git push --force origin HEAD:$GITHUB_REF || true

.github/workflows/stale.yml

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
name: Mark stale issues and pull requests
2+
on:
3+
schedule:
4+
- cron: "0 0 * * *"
5+
jobs:
6+
stale:
7+
runs-on: ubuntu-latest
8+
steps:
9+
- uses: actions/stale@v1
10+
with:
11+
repo-token: ${{ secrets.GITHUB_TOKEN }}
12+
stale-issue-message: 'Stale issue message'
13+
stale-pr-message: 'Stale pull request message'
14+
stale-issue-label: 'no-issue-activity'
15+
stale-pr-label: 'no-pr-activity'

.gitignore

Lines changed: 5 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -20,15 +20,13 @@ parts/
2020
sdist/
2121
var/
2222
wheels/
23-
pip-wheel-metadata/
24-
share/python-wheels/
2523
*.egg-info/
2624
.installed.cfg
2725
*.egg
2826
MANIFEST
2927

3028
# PyInstaller
31-
# Usually these files are written by a python script from a template
29+
# Usually these files are written by a Python script from a template
3230
# before PyInstaller builds the exe, so as to inject date/other infos into it.
3331
*.manifest
3432
*.spec
@@ -40,14 +38,12 @@ pip-delete-this-directory.txt
4038
# Unit test / coverage reports
4139
htmlcov/
4240
.tox/
43-
.nox/
4441
.coverage
4542
.coverage.*
4643
.cache
4744
nosetests.xml
4845
coverage.xml
4946
*.cover
50-
*.py,cover
5147
.hypothesis/
5248
.pytest_cache/
5349

@@ -59,7 +55,6 @@ coverage.xml
5955
*.log
6056
local_settings.py
6157
db.sqlite3
62-
db.sqlite3-journal
6358

6459
# Flask stuff:
6560
instance/
@@ -77,20 +72,9 @@ target/
7772
# Jupyter Notebook
7873
.ipynb_checkpoints
7974

80-
# IPython
81-
profile_default/
82-
ipython_config.py
83-
8475
# pyenv
8576
.python-version
8677

87-
# pipenv
88-
# According to pypa/pipenv#598, it is recommended to include Pipfile.lock in version control.
89-
# However, in case of collaboration, if having platform-specific dependencies or dependencies
90-
# having no cross-platform support, pipenv may install dependencies that don't work, or not
91-
# install all needed dependencies.
92-
#Pipfile.lock
93-
9478
# celery beat schedule file
9579
celerybeat-schedule
9680

@@ -118,8 +102,8 @@ venv.bak/
118102

119103
# mypy
120104
.mypy_cache/
121-
.dmypy.json
122-
dmypy.json
123105

124-
# Pyre type checker
125-
.pyre/
106+
.DS_Store
107+
.idea
108+
.try
109+
.vscode/

.gitpod.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
tasks:
2+
- init: pip3 install -r ./requirements.txt

.travis.yml

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
os: linux
2+
dist: bionic
3+
language: python
4+
python: 3.8
5+
cache: pip
6+
before_install: pip install --upgrade pip setuptools six
7+
install: pip install -r requirements.txt
8+
before_script:
9+
- black --check . || true
10+
- flake8 . --count --select=E101,E722,E9,F4,F63,F7,F82,W191 --show-source --statistics
11+
- flake8 . --count --exit-zero --max-line-length=127 --statistics
12+
script:
13+
- scripts/validate_filenames.py # no uppercase, no spaces, in a directory
14+
- mypy --ignore-missing-imports .
15+
- pytest --doctest-modules --cov-report=term-missing:skip-covered --cov=. .
16+
after_success:
17+
- scripts/build_directory_md.py 2>&1 | tee DIRECTORY.md

0 commit comments

Comments
 (0)