| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -1,38 +1,26 @@ | |||
| 1 | 1 | [flake8] | |
| 2 | + | ||
| 2 | 3 | show-source = True | |
| 3 | - count= True | ||
| 4 | + count = True | ||
| 4 | 5 | statistics = True | |
| 5 | - # E265 = comment blocks like @{ section, which it can't handle | ||
| 6 | + | ||
| 6 | 7 | # E266 = too many leading '#' for block comment | |
| 7 | 8 | # E731 = do not assign a lambda expression, use a def | |
| 8 | - # W293 = Blank line contains whitespace | ||
| 9 | - # W504 = Line break after operator | ||
| 10 | - # E704 = multiple statements in one line - used for @override | ||
| 11 | 9 | # TC002 = move third party import to TYPE_CHECKING | |
| 12 | - # ANN = flake8-annotations | ||
| 13 | 10 | # TC, TC2 = flake8-type-checking | |
| 14 | - # D = flake8-docstrings | ||
| 15 | 11 | ||
| 16 | 12 | # select = C,E,F,W ANN, TC, TC2 # to enable code. Disabled if not listed, including builtin codes | |
| 17 | 13 | enable-extensions = TC, TC2 # only needed for extensions not enabled by default | |
| 18 | 14 | ||
| 19 | - ignore = E265,E266,E731,E704, | ||
| 20 | - W293, W504, | ||
| 21 | - ANN0 ANN1 ANN2, | ||
| 22 | - TC002, | ||
| 23 | - TC0, TC1, TC2 | ||
| 24 | - # B, | ||
| 25 | - A, | ||
| 26 | - D, | ||
| 27 | - RST, RST3 | ||
| 15 | + ignore = E266, E731 | ||
| 28 | 16 | ||
| 29 | - exclude = .tox,.venv,build,dist,doc,git/ext/,test | ||
| 17 | + exclude = .tox, .venv, build, dist, doc, git/ext/ | ||
| 30 | 18 | ||
| 31 | 19 | rst-roles = # for flake8-RST-docstrings | |
| 32 | - attr,class,func,meth,mod,obj,ref,term,var # used by sphinx | ||
| 20 | + attr, class, func, meth, mod, obj, ref, term, var # used by sphinx | ||
| 33 | 21 | ||
| 34 | 22 | min-python-version = 3.7.0 | |
| 35 | 23 | ||
| 36 | 24 | # for `black` compatibility | |
| 37 | 25 | max-line-length = 120 | |
| 38 | - extend-ignore = E203,W503 | ||
| 26 | + extend-ignore = E203, W503 | ||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -1,2 +1,3 @@ | |||
| 1 | 1 | test/fixtures/* eol=lf | |
| 2 | - init-tests-after-clone.sh | ||
| 2 | + *.sh eol=lf | ||
| 3 | + /Makefile eol=lf | ||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -3,4 +3,4 @@ updates: | |||
| 3 | 3 | - package-ecosystem: "github-actions" | |
| 4 | 4 | directory: "/" | |
| 5 | 5 | schedule: | |
| 6 | - interval: "weekly" | ||
| 6 | + interval: "weekly" | ||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -5,20 +5,24 @@ on: [push, pull_request, workflow_dispatch] | |||
| 5 | 5 | jobs: | |
| 6 | 6 | build: | |
| 7 | 7 | runs-on: windows-latest | |
| 8 | + | ||
| 8 | 9 | strategy: | |
| 9 | 10 | fail-fast: false | |
| 11 | + | ||
| 10 | 12 | env: | |
| 11 | 13 | CHERE_INVOKING: 1 | |
| 12 | - SHELLOPTS: igncr | ||
| 13 | 14 | TMP: "/tmp" | |
| 14 | 15 | TEMP: "/tmp" | |
| 16 | + | ||
| 15 | 17 | defaults: | |
| 16 | 18 | run: | |
| 17 | - shell: bash.exe --noprofile --norc -exo pipefail -o igncr "{0}" | ||
| 19 | + shell: C:\cygwin\bin\bash.exe --noprofile --norc -exo pipefail -o igncr "{0}" | ||
| 18 | 20 | ||
| 19 | 21 | steps: | |
| 20 | 22 | - name: Force LF line endings | |
| 21 | - run: git config --global core.autocrlf input | ||
| 23 | + run: | | ||
| 24 | + git config --global core.autocrlf false # Affects the non-Cygwin git. | ||
| 25 | + shell: bash | ||
| 22 | 26 | ||
| 23 | 27 | - uses: actions/checkout@v4 | |
| 24 | 28 | with: | |
@@ -29,36 +33,42 @@ jobs: | |||
| 29 | 33 | with: | |
| 30 | 34 | packages: python39 python39-pip python39-virtualenv git | |
| 31 | 35 | ||
| 32 | - - name: Show python and git versions | ||
| 36 | + - name: Special configuration for Cygwin's git | ||
| 33 | 37 | run: | | |
| 34 | - /usr/bin/python --version | ||
| 35 | - /usr/bin/git version | ||
| 36 | - | ||
| 37 | - - name: Tell git to trust this repo | ||
| 38 | - run: | | ||
| 39 | - /usr/bin/git config --global --add safe.directory "$(pwd)" | ||
| 38 | + git config --global --add safe.directory "$(pwd)" | ||
| 39 | + git config --global core.autocrlf false | ||
| 40 | 40 | ||
| 41 | 41 | - name: Prepare this repo for tests | |
| 42 | 42 | run: | | |
| 43 | - TRAVIS=yes ./init-tests-after-clone.sh | ||
| 43 | + ./init-tests-after-clone.sh | ||
| 44 | 44 | ||
| 45 | - - name: Further prepare git configuration for tests | ||
| 45 | + - name: Set git user identity and command aliases for the tests | ||
| 46 | 46 | run: | | |
| 47 | - /usr/bin/git config --global user.email "travis@ci.com" | ||
| 48 | - /usr/bin/git config --global user.name "Travis Runner" | ||
| 47 | + git config --global user.email "travis@ci.com" | ||
| 48 | + git config --global user.name "Travis Runner" | ||
| 49 | 49 | # If we rewrite the user's config by accident, we will mess it up | |
| 50 | 50 | # and cause subsequent tests to fail | |
| 51 | 51 | cat test/fixtures/.gitconfig >> ~/.gitconfig | |
| 52 | 52 | ||
| 53 | 53 | - name: Update PyPA packages | |
| 54 | 54 | run: | | |
| 55 | - /usr/bin/python -m pip install --upgrade pip setuptools wheel | ||
| 55 | + # Get the latest pip, wheel, and prior to Python 3.12, setuptools. | ||
| 56 | + python -m pip install -U pip $(pip freeze --all | grep -oF setuptools) wheel | ||
| 56 | 57 | ||
| 57 | 58 | - name: Install project and test dependencies | |
| 58 | 59 | run: | | |
| 59 | - /usr/bin/python -m pip install ".[test]" | ||
| 60 | + python -m pip install ".[test]" | ||
| 61 | + | ||
| 62 | + - name: Show version and platform information | ||
| 63 | + run: | | ||
| 64 | + uname -a | ||
| 65 | + command -v git python | ||
| 66 | + git version | ||
| 67 | + python --version | ||
| 68 | + python -c 'import sys; print(sys.platform)' | ||
| 69 | + python -c 'import os; print(os.name)' | ||
| 70 | + python -c 'import git; print(git.compat.is_win)' | ||
| 60 | 71 | ||
| 61 | 72 | - name: Test with pytest | |
| 62 | 73 | run: | | |
| 63 | - set +x | ||
| 64 | - /usr/bin/python -m pytest | ||
| 74 | + python -m pytest --color=yes -p no:sugar --instafail -vv | ||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -7,8 +7,14 @@ jobs: | |||
| 7 | 7 | runs-on: ubuntu-latest | |
| 8 | 8 | ||
| 9 | 9 | steps: | |
| 10 | - - uses: actions/checkout@v4 | ||
| 11 | - - uses: actions/setup-python@v4 | ||
| 12 | - with: | ||
| 13 | - python-version: "3.x" | ||
| 14 | - - uses: pre-commit/action@v3.0.0 | ||
| 10 | + - uses: actions/checkout@v4 | ||
| 11 | + | ||
| 12 | + - uses: actions/setup-python@v4 | ||
| 13 | + with: | ||
| 14 | + python-version: "3.x" | ||
| 15 | + | ||
| 16 | + - uses: pre-commit/action@v3.0.0 | ||
| 17 | + with: | ||
| 18 | + extra_args: --all-files --hook-stage manual | ||
| 19 | + env: | ||
| 20 | + SKIP: black-format | ||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -10,16 +10,15 @@ permissions: | |||
| 10 | 10 | ||
| 11 | 11 | jobs: | |
| 12 | 12 | build: | |
| 13 | - | ||
| 14 | 13 | runs-on: ubuntu-latest | |
| 14 | + | ||
| 15 | 15 | strategy: | |
| 16 | 16 | fail-fast: false | |
| 17 | 17 | matrix: | |
| 18 | 18 | python-version: ["3.7", "3.8", "3.9", "3.10", "3.11", "3.12"] | |
| 19 | 19 | include: | |
| 20 | - - experimental: false | ||
| 21 | - - python-version: "3.12" | ||
| 22 | - experimental: true | ||
| 20 | + - experimental: false | ||
| 21 | + | ||
| 23 | 22 | defaults: | |
| 24 | 23 | run: | |
| 25 | 24 | shell: /bin/bash --noprofile --norc -exo pipefail {0} | |
@@ -36,16 +35,11 @@ jobs: | |||
| 36 | 35 | python-version: ${{ matrix.python-version }} | |
| 37 | 36 | allow-prereleases: ${{ matrix.experimental }} | |
| 38 | 37 | ||
| 39 | - - name: Show python and git versions | ||
| 40 | - run: | | ||
| 41 | - python --version | ||
| 42 | - git version | ||
| 43 | - | ||
| 44 | 38 | - name: Prepare this repo for tests | |
| 45 | 39 | run: | | |
| 46 | - TRAVIS=yes ./init-tests-after-clone.sh | ||
| 40 | + ./init-tests-after-clone.sh | ||
| 47 | 41 | ||
| 48 | - - name: Prepare git configuration for tests | ||
| 42 | + - name: Set git user identity and command aliases for the tests | ||
| 49 | 43 | run: | | |
| 50 | 44 | git config --global user.email "travis@ci.com" | |
| 51 | 45 | git config --global user.name "Travis Runner" | |
@@ -55,17 +49,23 @@ jobs: | |||
| 55 | 49 | ||
| 56 | 50 | - name: Update PyPA packages | |
| 57 | 51 | run: | | |
| 58 | - python -m pip install --upgrade pip | ||
| 59 | - if pip freeze --all | grep --quiet '^setuptools=='; then | ||
| 60 | - # Python prior to 3.12 ships setuptools. Upgrade it if present. | ||
| 61 | - python -m pip install --upgrade setuptools | ||
| 62 | - fi | ||
| 63 | - python -m pip install --upgrade wheel | ||
| 52 | + # Get the latest pip, wheel, and prior to Python 3.12, setuptools. | ||
| 53 | + python -m pip install -U pip $(pip freeze --all | grep -oF setuptools) wheel | ||
| 64 | 54 | ||
| 65 | 55 | - name: Install project and test dependencies | |
| 66 | 56 | run: | | |
| 67 | 57 | pip install ".[test]" | |
| 68 | 58 | ||
| 59 | + - name: Show version and platform information | ||
| 60 | + run: | | ||
| 61 | + uname -a | ||
| 62 | + command -v git python | ||
| 63 | + git version | ||
| 64 | + python --version | ||
| 65 | + python -c 'import sys; print(sys.platform)' | ||
| 66 | + python -c 'import os; print(os.name)' | ||
| 67 | + python -c 'import git; print(git.compat.is_win)' | ||
| 68 | + | ||
| 69 | 69 | - name: Check types with mypy | |
| 70 | 70 | run: | | |
| 71 | 71 | mypy -p git | |
@@ -75,7 +75,7 @@ jobs: | |||
| 75 | 75 | ||
| 76 | 76 | - name: Test with pytest | |
| 77 | 77 | run: | | |
| 78 | - pytest | ||
| 78 | + pytest --color=yes -p no:sugar --instafail -vv | ||
| 79 | 79 | continue-on-error: false | |
| 80 | 80 | ||
| 81 | 81 | - name: Documentation | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -1,12 +1,15 @@ | |||
| 1 | 1 | *.py[co] | |
| 2 | 2 | *.swp | |
| 3 | 3 | *~ | |
| 4 | + .env/ | ||
| 5 | + env/ | ||
| 4 | 6 | .venv/ | |
| 5 | 7 | venv/ | |
| 6 | 8 | /*.egg-info | |
| 7 | 9 | /lib/GitPython.egg-info | |
| 8 | 10 | cover/ | |
| 9 | 11 | .coverage | |
| 12 | + .coverage.* | ||
| 10 | 13 | /build | |
| 11 | 14 | /dist | |
| 12 | 15 | /doc/_build | |
@@ -22,4 +25,3 @@ nbproject | |||
| 22 | 25 | .pytest_cache/ | |
| 23 | 26 | monkeytype.sqlite3 | |
| 24 | 27 | output.txt | |
| 25 | - tox.ini | ||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -1,19 +1,39 @@ | |||
| 1 | 1 | repos: | |
| 2 | - - repo: https://github.com/PyCQA/flake8 | ||
| 3 | - rev: 6.0.0 | ||
| 4 | - hooks: | ||
| 5 | - - id: flake8 | ||
| 6 | - additional_dependencies: | ||
| 7 | - [ | ||
| 8 | - flake8-bugbear==22.12.6, | ||
| 9 | - flake8-comprehensions==3.10.1, | ||
| 10 | - flake8-typing-imports==1.14.0, | ||
| 11 | - ] | ||
| 12 | - exclude: ^doc|^git/ext/|^test/ | ||
| 2 | + - repo: https://github.com/psf/black-pre-commit-mirror | ||
| 3 | + rev: 23.9.1 | ||
| 4 | + hooks: | ||
| 5 | + - id: black | ||
| 6 | + alias: black-check | ||
| 7 | + name: black (check) | ||
| 8 | + args: [--check, --diff] | ||
| 9 | + exclude: ^git/ext/ | ||
| 10 | + stages: [manual] | ||
| 13 | 11 | ||
| 14 | - - repo: https://github.com/pre-commit/pre-commit-hooks | ||
| 15 | - rev: v4.4.0 | ||
| 16 | - hooks: | ||
| 17 | - - id: check-merge-conflict | ||
| 18 | - - id: check-toml | ||
| 19 | - - id: check-yaml | ||
| 12 | + - id: black | ||
| 13 | + alias: black-format | ||
| 14 | + name: black (format) | ||
| 15 | + exclude: ^git/ext/ | ||
| 16 | + | ||
| 17 | + - repo: https://github.com/PyCQA/flake8 | ||
| 18 | + rev: 6.1.0 | ||
| 19 | + hooks: | ||
| 20 | + - id: flake8 | ||
| 21 | + additional_dependencies: | ||
| 22 | + - flake8-bugbear==23.9.16 | ||
| 23 | + - flake8-comprehensions==3.14.0 | ||
| 24 | + - flake8-typing-imports==1.14.0 | ||
| 25 | + exclude: ^doc|^git/ext/ | ||
| 26 | + | ||
| 27 | + - repo: https://github.com/shellcheck-py/shellcheck-py | ||
| 28 | + rev: v0.9.0.5 | ||
| 29 | + hooks: | ||
| 30 | + - id: shellcheck | ||
| 31 | + args: [--color] | ||
| 32 | + exclude: ^git/ext/ | ||
| 33 | + | ||
| 34 | + - repo: https://github.com/pre-commit/pre-commit-hooks | ||
| 35 | + rev: v4.4.0 | ||
| 36 | + hooks: | ||
| 37 | + - id: check-toml | ||
| 38 | + - id: check-yaml | ||
| 39 | + - id: check-merge-conflict | ||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -52,4 +52,5 @@ Contributors are: | |||
| 52 | 52 | -Joseph Hale <me _at_ jhale.dev> | |
| 53 | 53 | -Santos Gallegos <stsewd _at_ proton.me> | |
| 54 | 54 | -Wenhan Zhu <wzhu.cosmos _at_ gmail.com> | |
| 55 | + | ||
| 55 | 56 | Portions derived from other open source works and are clearly marked. | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -2,7 +2,7 @@ | |||
| 2 | 2 | ||
| 3 | 3 | The following is a short step-by-step rundown of what one typically would do to contribute. | |
| 4 | 4 | ||
| 5 | - - [fork this project](https://github.com/gitpython-developers/GitPython/fork) on GitHub. | ||
| 5 | + - [Fork this project](https://github.com/gitpython-developers/GitPython/fork) on GitHub. | ||
| 6 | 6 | - For setting up the environment to run the self tests, please run `init-tests-after-clone.sh`. | |
| 7 | 7 | - Please try to **write a test that fails unless the contribution is present.** | |
| 8 | 8 | - Try to avoid massive commits and prefer to take small steps, with one commit for each. | |
| Back | FazBrowse Home | New Git URL |
0 commit comments