-
Notifications
You must be signed in to change notification settings - Fork 19
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Various pre-commit updates: * fast-fail on syntax errors * control future imports * update black to stable version * add clang-format for C/C++ * run flake8-comprehensions checks Co-authored-by: Nicholas Devenish <ndevenish@gmail.com>
- Loading branch information
Showing
90 changed files
with
244 additions
and
113 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 |
---|---|---|
@@ -1,3 +1,5 @@ | ||
from __future__ import annotations | ||
|
||
import argparse | ||
import multiprocessing.pool | ||
import os | ||
|
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 |
---|---|---|
@@ -1,3 +1,5 @@ | ||
from __future__ import annotations | ||
|
||
import os | ||
import subprocess | ||
|
||
|
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 |
---|---|---|
@@ -1,3 +1,5 @@ | ||
from __future__ import annotations | ||
|
||
import ast | ||
import os | ||
import sys | ||
|
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 |
---|---|---|
@@ -1,35 +1,54 @@ | ||
repos: | ||
# Syntax validation and some basic sanity checks | ||
- repo: /~https://github.com/pre-commit/pre-commit-hooks | ||
rev: v4.1.0 | ||
hooks: | ||
- id: check-merge-conflict | ||
- id: check-ast | ||
fail_fast: True | ||
- id: check-json | ||
- id: check-added-large-files | ||
args: ['--maxkb=200'] | ||
- id: check-yaml | ||
args: ['--allow-multiple-documents'] | ||
- id: no-commit-to-branch | ||
name: "Don't commit to 'main' directly" | ||
|
||
# Automatically sort imports | ||
- repo: /~https://github.com/PyCQA/isort.git | ||
rev: 5.9.2 | ||
- repo: /~https://github.com/PyCQA/isort | ||
rev: 5.10.1 | ||
hooks: | ||
- id: isort | ||
args: [ | ||
'-a', 'from __future__ import annotations', # 3.7-3.11 | ||
'--rm', 'from __future__ import absolute_import', # -3.0 | ||
'--rm', 'from __future__ import division', # -3.0 | ||
'--rm', 'from __future__ import generator_stop', # -3.7 | ||
'--rm', 'from __future__ import generators', # -2.3 | ||
'--rm', 'from __future__ import nested_scopes', # -2.2 | ||
'--rm', 'from __future__ import print_function', # -3.0 | ||
'--rm', 'from __future__ import unicode_literals', # -3.0 | ||
'--rm', 'from __future__ import with_statement', # -2.6 | ||
] | ||
|
||
# Automatic source code formatting | ||
- repo: /~https://github.com/psf/black | ||
rev: 21.6b0 | ||
rev: 22.1.0 | ||
hooks: | ||
- id: black | ||
args: [--safe, --quiet] | ||
files: \.pyi?$|SConscript$|^libtbx_config$ | ||
types: [file] | ||
|
||
- repo: /~https://github.com/pre-commit/mirrors-clang-format | ||
rev: v13.0.1 | ||
hooks: | ||
- id: clang-format | ||
files: \.c(c|pp|xx)?$|\.h(pp)?$ | ||
|
||
# Linting | ||
- repo: /~https://github.com/PyCQA/flake8 | ||
rev: 3.9.2 | ||
rev: 4.0.1 | ||
hooks: | ||
- id: flake8 | ||
|
||
# Syntax validation and some basic sanity checks | ||
- repo: /~https://github.com/pre-commit/pre-commit-hooks | ||
rev: v4.0.1 | ||
hooks: | ||
- id: check-ast | ||
- id: check-yaml | ||
args: ['--allow-multiple-documents'] | ||
- id: check-merge-conflict | ||
- id: check-added-large-files | ||
args: ['--maxkb=200'] | ||
- id: no-commit-to-branch | ||
name: "Don't commit to main directly" | ||
additional_dependencies: ['flake8-comprehensions==3.8.0'] |
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 |
---|---|---|
|
@@ -8,6 +8,8 @@ | |
path anyway). | ||
""" | ||
|
||
from __future__ import annotations | ||
|
||
import json | ||
import os | ||
import pickle | ||
|
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 |
---|---|---|
@@ -1,3 +1,5 @@ | ||
from __future__ import annotations | ||
|
||
import inspect | ||
import os | ||
import random | ||
|
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 @@ | ||
Update pre-commit environments |
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 |
---|---|---|
@@ -1,3 +1,5 @@ | ||
from __future__ import annotations | ||
|
||
from pathlib import Path | ||
|
||
import setuptools | ||
|
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
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
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
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 |
---|---|---|
@@ -1,3 +1,5 @@ | ||
from __future__ import annotations | ||
|
||
import procrunner | ||
import pytest | ||
|
||
|
Oops, something went wrong.