Skip to content

Commit

Permalink
improve elisp filename prefix and -pkg.el checks
Browse files Browse the repository at this point in the history
  • Loading branch information
riscy committed Apr 28, 2024
1 parent cbabd71 commit e55ce2d
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions melpazoid/melpazoid.py
Original file line number Diff line number Diff line change
Expand Up @@ -499,13 +499,17 @@ def _check_url(recipe: str, elisp_dir: Path) -> None:
def _check_filenames(recipe: str, elisp_dir: Path) -> None:
for file in _files_in_recipe(recipe, elisp_dir):
relpath = file.relative_to(elisp_dir)
if file.name.endswith('-pkg.el'):
if file.name == f"{package_name(recipe)}-pkg.el":
_note(
f"- {relpath} -- consider excluding; "
+ f"MELPA can create one from {file.name[:-7]}.el",
+ f"MELPA can create one from {package_name(recipe)}.el",
CLR_WARN,
)
if file.name.endswith('.el') and not file.name.startswith(package_name(recipe)):
elif file.name.endswith('-pkg.el'):
_fail(f"- {relpath} -- files ending in `-pkg.el` are only for packaging")
if file.name.endswith('.el') and not re.match(
f"^{package_name(recipe)}[-.]", file.name
):
_fail(f"- {relpath} -- not in package namespace `{package_name(recipe)}-`")


Expand Down

0 comments on commit e55ce2d

Please sign in to comment.