Skip to content

Commit 2ee6cf0

Browse files
sbidoulyajo
authored andcommitted
Remove need for --trust/--UNSAFE
1 parent 956e371 commit 2ee6cf0

5 files changed

Lines changed: 9 additions & 13 deletions

File tree

README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ pipx install copier
2626
pipx install pre-commit
2727
pipx ensurepath
2828
# Clone this template and answer its questions
29-
copier copy --UNSAFE https://github.com/OCA/oca-addons-repo-template.git some-repo
29+
copier copy https://github.com/OCA/oca-addons-repo-template.git some-repo
3030
# Commit that
3131
cd some-repo
3232
git add .
@@ -40,7 +40,7 @@ Quick answer to update a repo:
4040
```bash
4141
# Update the repo
4242
cd some-repo
43-
copier update --UNSAFE
43+
copier update
4444
# Reformat updated files
4545
pre-commit run
4646
# Commit update

copier.yml

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -3,15 +3,6 @@ _templates_suffix: .jinja
33
_subdirectory: src
44
_min_copier_version: "9"
55

6-
_tasks:
7-
- rm -f .travis.yml .t2d.yml
8-
- "{% if odoo_version >= 18 %}rm -f .prettierrc.yml .eslintrc.yml{% endif %}"
9-
10-
_migrations:
11-
- version: v1.3.6
12-
after:
13-
- rm -f CONTRIBUTING.md
14-
156
odoo_version:
167
type: float
178
default: 19.0

src/.pre-commit-config.yaml.jinja

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -161,6 +161,11 @@ repos:
161161
entry: found a en.po file
162162
language: fail
163163
files: '[a-zA-Z0-9_]*/i18n/en\.po$'
164+
- id: obsolete dotfiles
165+
name: obsolete dotfiles
166+
entry: found obsolete files; remove them
167+
files: '^(\.travis\.yml|\.t2d\.yml|CONTRIBUTING\.md{% if odoo_version >= 18 %}|\.prettierrc\.yml|\.eslintrc\.yml{% endif %})$'
168+
language: fail
164169
{%- if use_pyproject_toml %}
165170
- repo: https://github.com/sbidoul/whool
166171
rev: v1.3

tests/test_copy.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ def test_bootstrap(tmp_path: Path, odoo_version: float, cloned_template: Path):
3131
"repo_name": "Test repo",
3232
"repo_description": "Test repo description",
3333
}
34-
run_copy(str(cloned_template), tmp_path, data=data, defaults=True, unsafe=True)
34+
run_copy(str(cloned_template), tmp_path, data=data, defaults=True)
3535
# When loading YAML files, we are also testing their syntax is correct, which
3636
# can be a little bit tricky due to the way both Jinja and YAML handle whitespace
3737
answers = yaml.safe_load((tmp_path / ".copier-answers.yml").read_text())

tests/test_pre_commit.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ def test_hooks_installable(tmp_path: Path, odoo_version: float, cloned_template:
1313
"repo_name": "Test repo",
1414
"repo_description": "Test repo description",
1515
}
16-
run_copy(str(cloned_template), tmp_path, data=data, defaults=True, unsafe=True)
16+
run_copy(str(cloned_template), tmp_path, data=data, defaults=True)
1717
with local.cwd(tmp_path):
1818
git("init")
1919
pre_commit("install-hooks")

0 commit comments

Comments
 (0)