Skip to content

Commit 364815a

Browse files
committed
feat(pre-commit): add detect-secrets, nbstripout and other standard pre-commit hooks
1 parent 8156391 commit 364815a

4 files changed

Lines changed: 44 additions & 24 deletions

File tree

‎template/.claude/settings.json‎

Lines changed: 17 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -1,21 +1,4 @@
11
{
2-
"sandbox": {
3-
"enabled": true,
4-
"autoAllowBashIfSandboxed": true,
5-
"excludedCommands": [
6-
"docker",
7-
"git"
8-
],
9-
"network": {
10-
"allowedDomains": [
11-
"github.com"
12-
],
13-
"allowUnixSockets": [
14-
"/var/run/docker.sock"
15-
],
16-
"allowLocalBinding": true
17-
}
18-
},
192
"permissions": {
203
"allow": [
214
"Bash(git commit *)",
@@ -31,5 +14,22 @@
3114
"Read(.env.*)",
3215
"Read(~/.aws/**)"
3316
]
17+
},
18+
"sandbox": {
19+
"autoAllowBashIfSandboxed": true,
20+
"enabled": true,
21+
"excludedCommands": [
22+
"docker",
23+
"git"
24+
],
25+
"network": {
26+
"allowLocalBinding": true,
27+
"allowUnixSockets": [
28+
"/var/run/docker.sock"
29+
],
30+
"allowedDomains": [
31+
"github.com"
32+
]
33+
}
3434
}
3535
}

‎template/.pre-commit-config.yaml.jinja‎

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,29 @@ repos:
1414
- id: yamllint
1515
args: [-d, "{extends: relaxed, rules: {line-length: disable} }"]
1616
verbose: true
17+
- repo: https://github.com/Yelp/detect-secrets
18+
rev: v1.5.0
19+
hooks:
20+
- id: detect-secrets
21+
exclude: ^\.venv/
22+
- repo: https://github.com/kynan/nbstripout
23+
rev: '0.9.1'
24+
hooks:
25+
- id: nbstripout
26+
files: \.ipynb$
27+
- repo: https://github.com/pre-commit/pre-commit-hooks
28+
rev: v5.0.0
29+
hooks:
30+
- id: mixed-line-ending
31+
args: [--fix=lf]
32+
- id: end-of-file-fixer
33+
- id: trailing-whitespace
34+
- id: check-added-large-files
35+
- id: check-merge-conflict
36+
- id: check-case-conflict
37+
- id: check-symlinks
38+
- id: pretty-format-json
39+
args: [--autofix]
1740
- repo: local
1841
hooks:
1942
- id: ty

‎template/LICENSE.jinja‎

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -20,8 +20,7 @@ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
2020
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
2121
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
2222
SOFTWARE.
23-
24-
{% elif license == "Apache-2.0" -%}
23+
{%- elif license == "Apache-2.0" -%}
2524
Copyright {{ "%Y" | strftime }} {{ author_name }}
2625

2726
Licensed under the Apache License, Version 2.0 (the "License");
@@ -35,8 +34,7 @@ Copyright {{ "%Y" | strftime }} {{ author_name }}
3534
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
3635
See the License for the specific language governing permissions and
3736
limitations under the License.
38-
39-
{% elif "GPL-3.0" in license -%}
37+
{%- elif "GPL-3.0" in license -%}
4038
{{ project_name }}: {{ project_short_description }}
4139
Copyright (C) {{ "%Y" | strftime }} {{ author_name }}
4240

@@ -52,5 +50,4 @@ GNU General Public License for more details.
5250

5351
You should have received a copy of the GNU General Public License
5452
along with this program. If not, see <https://www.gnu.org/licenses/>.
55-
56-
{% endif -%}
53+
{%- endif %}

‎template/pyproject.toml.jinja‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -154,4 +154,4 @@ forbidden_modules = [
154154
"requests",
155155
"sqlalchemy",
156156
]
157-
{% endif %}
157+
{%- endif %}

0 commit comments

Comments
 (0)