Skip to content

Commit 98f6f8a

Browse files
committed
Linting
1 parent 9b155aa commit 98f6f8a

File tree

3 files changed

+8
-8
lines changed

3 files changed

+8
-8
lines changed

.github/ISSUE_TEMPLATE/bug.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@ labels: bug
1313
<!-- To assist you best, please include commands that you've run, options you've selected and any relevant logs -->
1414

1515
- Host system configuration:
16+
1617
- Version of cookiecutter CLI (get it with `cookiecutter --version`):
1718
- OS name and version:
1819

hooks/post_gen_project.py

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -203,7 +203,7 @@ def remove_prettier_pre_commit():
203203

204204
def remove_repo_from_pre_commit_config(repo_to_remove: str):
205205
pre_commit_config = Path(".pre-commit-config.yaml")
206-
content = pre_commit_config.read_text().splitlines(True)
206+
content = pre_commit_config.read_text().splitlines(keepends=True)
207207

208208
removing = False
209209
new_lines = []
@@ -517,7 +517,7 @@ def setup_dependencies():
517517
if "{{ cookiecutter.use_docker }}".lower() == "y":
518518
# Build the Docker service using Docker Compose
519519
try:
520-
subprocess.run(["docker", "compose", "-f", "docker-compose.local.yml", "build", "django"], check=True)
520+
subprocess.run(["docker", "compose", "-f", "docker-compose.local.yml", "build", "django"], check=True) # noqa: S607
521521
except subprocess.CalledProcessError as e:
522522
print(f"Error building Docker service: {e}", file=sys.stderr)
523523
sys.exit(1)
@@ -530,23 +530,23 @@ def setup_dependencies():
530530

531531
# Install production dependencies
532532
try:
533-
subprocess.run(uv_cmd + ["add", "--no-sync", "-r", "requirements/production.txt"], check=True)
533+
subprocess.run([*uv_cmd, "add", "--no-sync", "-r", "requirements/production.txt"], check=True) # noqa: S603
534534
except subprocess.CalledProcessError as e:
535535
print(f"Error installing production dependencies: {e}", file=sys.stderr)
536536
sys.exit(1)
537537

538538
# Install local (development) dependencies
539539
try:
540-
subprocess.run(uv_cmd + ["add", "--no-sync", "--dev", "-r", "requirements/local.txt"], check=True)
540+
subprocess.run([*uv_cmd, "add", "--no-sync", "--dev", "-r", "requirements/local.txt"], check=True) # noqa: S603
541541
except subprocess.CalledProcessError as e:
542542
print(f"Error installing local dependencies: {e}", file=sys.stderr)
543543
sys.exit(1)
544544

545545
# Remove the requirements directory
546-
if os.path.exists("requirements"):
546+
if os.path.exists("requirements"): # noqa: PTH110
547547
try:
548548
shutil.rmtree("requirements")
549-
except Exception as e:
549+
except Exception as e: # noqa: BLE001
550550
print(f"Error removing 'requirements' folder: {e}", file=sys.stderr)
551551
sys.exit(1)
552552

tests/test_cookiecutter_generation.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -157,8 +157,7 @@ def build_files_list(base_path: Path):
157157
for dirpath, subdirs, files in base_path.walk():
158158
subdirs[:] = [d for d in subdirs if d not in excluded_dirs]
159159

160-
for file_path in files:
161-
f.append(dirpath / file_path)
160+
f.extend(dirpath / file_path for file_path in files)
162161
return f
163162

164163

0 commit comments

Comments
 (0)