Skip to content

added check for crlf to workers.txt - #3207

Open
StrangeDrVN wants to merge 10 commits into
masterfrom
strange-patch-7/1
Open

added check for crlf to workers.txt#3207
StrangeDrVN wants to merge 10 commits into
masterfrom
strange-patch-7/1

Conversation

@StrangeDrVN

@StrangeDrVN StrangeDrVN commented Jul 14, 2026

Copy link
Copy Markdown
Contributor
  • worker.txt needs to be in CRLF
  • add scripts/commands/workers/validate.ts and integrate it to check.yml

@StrangeDrVN
StrangeDrVN requested a review from freearhey July 14, 2026 08:08
@freearhey

Copy link
Copy Markdown
Collaborator

Maybe it would be better to create a script commands/workers/validate.ts similar to channels/validate.ts and call it from the action.

@StrangeDrVN

Copy link
Copy Markdown
Contributor Author

Maybe it would be better to create a script commands/workers/validate.ts similar to channels/validate.ts and call it from the action.

That makes sense. By 'call it from the action.' you mean to the check.yml?

Comment thread scripts/commands/workers/validate.ts Fixed
Comment thread scripts/commands/workers/validate.ts Fixed
@freearhey

Copy link
Copy Markdown
Collaborator

I think so.

@StrangeDrVN StrangeDrVN linked an issue Jul 14, 2026 that may be closed by this pull request
@StrangeDrVN

Copy link
Copy Markdown
Contributor Author

@freearhey Isn't this because the script has not been added yet? And the script addition doesn't seem to be identified by the check.yml.

##[group]Run npm run workers:validate
npm run workers:validate
shell: /usr/bin/bash -e {0}
##[endgroup]

> workers:validate
> tsx scripts/commands/workers/validate.ts

sh: 1: tsx: not found
##[error]Process completed with exit code 127.

@freearhey

Copy link
Copy Markdown
Collaborator

Yes, according to the report https://github.com/iptv-org/epg/actions/runs/29319998749/job/87042801320?pr=3207 this is the reason.

@tohenk

tohenk commented Jul 23, 2026

Copy link
Copy Markdown
Collaborator

Why don't we use simple solution using .gitattributes to address different EOL across OSes?

@freearhey

Copy link
Copy Markdown
Collaborator

We tried it, but if a file with an incorrect line ending made its way into the repository, it would block all further commits: #2871

@freearhey freearhey left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could you also add a test for workers/validate.ts?

@tohenk

tohenk commented Jul 29, 2026

Copy link
Copy Markdown
Collaborator

@freearhey Can I have write access to this repository?

@freearhey

Copy link
Copy Markdown
Collaborator

@tohenk But you already have write access to all repositories in the iptv-org:

image

@tohenk
tohenk force-pushed the strange-patch-7/1 branch from ef189cc to 64bf194 Compare July 29, 2026 17:34
@tohenk
tohenk force-pushed the strange-patch-7/1 branch from 64bf194 to dc8b634 Compare July 29, 2026 17:39
Signed-off-by: Toha <tohenk@yahoo.com>
@tohenk tohenk changed the title added check for crlf to worker.txt added check for crlf to workers.txt Aug 1, 2026

@freearhey freearhey left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If the new .gitattributes will work as intended (#3229), do we even need a separate script to check a single .txt file?

@StrangeDrVN

StrangeDrVN commented Aug 1, 2026

Copy link
Copy Markdown
Contributor Author

If the new .gitattributes will work as intended (#3229), do we even need a separate script to check a single .txt file?

Does adding new server/link via GitHub web editor to the .txt ignore .gitattributes and save with LF?

Wouldn't it be better to add an issue form to add a server instead of creating a PR?

@freearhey

Copy link
Copy Markdown
Collaborator

Does adding new server/link via GitHub web editor to the .txt ignore .gitattributes and save with LF?

Good question.

Wouldn't it be better to add an issue form to add a server instead of creating a PR?

Well, I think creating a separate template and script just to add a single line to a file is definitely overkill.

@freearhey
freearhey dismissed their stale review August 1, 2026 19:01

Resolved.

@fridrich

fridrich commented Aug 2, 2026

Copy link
Copy Markdown
Contributor

If the new .gitattributes will work as intended (#3229), do we even need a separate script to check a single .txt file?

Not only that it does not work, but introducing the * text=auto simply introduced a system dependency. It makes all the files be reformated on linux on any git invocation. I had to remove the .gitattributes file in my local checkout, because even git reset --hard was leaving modified files. It is quite difficult to get the .gitattributes right, and a pre-commit hook is the best thing to do.

@freearhey

Copy link
Copy Markdown
Collaborator

I had to remove the .gitattributes file in my local checkout, because even git reset --hard was leaving modified files

Here's another trick that might help:

In the .git/info folder, create a file named attributes and add * -text to it. This overrides any rules specified in .gitattributes and it will not be reflected in the commit history.

@fridrich

fridrich commented Aug 2, 2026

Copy link
Copy Markdown
Contributor

In the .git/info folder, create a file named attributes and add * -text to it. This overrides any rules specified in .gitattributes and it will not be reflected in the commit history.

That is a very useful hint and I will for sure use it. There is still my point that this your approach is way better then the .gitattributes, since they are very difficult to get right unless one understands the thing inside out. Currently, on a linux system a clean git clone results in a dirty repository.

@tohenk

tohenk commented Aug 3, 2026

Copy link
Copy Markdown
Collaborator

We need renormalize after adding .gitattributes in a new PR.

git add --renormalize .

@fridrich

fridrich commented Aug 3, 2026

Copy link
Copy Markdown
Contributor

We need renormalize after adding .gitattributes in a new PR.

git add --renormalize .

Still that * text=auto will do what? Will the next entries override it or will they catch only what was not caught before.

@freearhey

Copy link
Copy Markdown
Collaborator

We need renormalize after adding .gitattributes in a new PR.

Has anyone done this kind of PR yet? And in the end, do we still need workers:validate?

@tohenk

tohenk commented Aug 11, 2026

Copy link
Copy Markdown
Collaborator

Has anyone done this kind of PR yet? And in the end, do we still need workers:validate?

It won't be needed anymore.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

Worker loading failed

5 participants