Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

question/bug(unix): paths and glob syntax in UNIX CLI commands #800

Open
Kristinita opened this issue Dec 27, 2023 · 0 comments
Open

question/bug(unix): paths and glob syntax in UNIX CLI commands #800

Kristinita opened this issue Dec 27, 2023 · 0 comments

Comments

@Kristinita
Copy link

Kristinita commented Dec 27, 2023

1. Summary

These CLI commands for linting files in folders and subfolders works on Windows, but not on Ubuntu:

djlint --profile=jinja --lint KiraTemplates

djlint --profile=jinja --lint KiraTemplates/**/*.html

This looks like a bug. But if this is not a bug, it would be nice to add to the djLint documentation about the syntax of CLI commands on UNIX and Windows.

2. MCVE

2.1. Files

KiraTemplates/KiraRootTemplate.html:

{{KIRA_FIRST_VARIABLE}}

KiraTemplates/KiraFolder/KiraFolderTemplate.html:

{{KIRA_SECOND_VARIABLE}}

2.2. Steps to reproduce

djlint --profile=jinja --lint KiraTemplates
djlint --profile=jinja --lint KiraTemplates/**/*.html

2.3. Online

This configuration on the branch KiraDjLintGlob of my GitHub repository for debugging and demonstrations.

CI builds for this configuration:

  1. AppVeyor — Windows build
  2. Travis — Ubuntu build

3. Behavior

3.1. Expected

On my local Windows machine and on AppVeyor:

djlint --profile=jinja --lint KiraTemplates
Linting 2/2 files ���������� 00:00    
KiraTemplates\KiraFolder\KiraFolderTemplate.html
───────────────────────────────────────────────────────────────────────────────
T001 1:0 Variables should be wrapped in a whitespace. {{KIRA_SECOND_VARIAB
KiraTemplates\KiraRootTemplate.html
───────────────────────────────────────────────────────────────────────────────
T001 1:0 Variables should be wrapped in a whitespace. {{KIRA_FIRST_VARIABL
Linted 2 files, found 2 errors.
Command exited with code 1


djlint --profile=jinja --lint KiraTemplates/**/*.html
Linting 2/2 files ���������� 00:00    
KiraTemplates\KiraFolder\KiraFolderTemplate.html
───────────────────────────────────────────────────────────────────────────────
T001 1:0 Variables should be wrapped in a whitespace. {{KIRA_SECOND_VARIAB
KiraTemplates\KiraRootTemplate.html
───────────────────────────────────────────────────────────────────────────────
T001 1:0 Variables should be wrapped in a whitespace. {{KIRA_FIRST_VARIABL
Linted 2 files, found 2 errors.
Command exited with code 1

djLint successfully lints both files KiraTemplates\KiraFolder\KiraFolderTemplate.html and KiraTemplates\KiraRootTemplate.html in both cases.

3.2. Non-expected

Travis:

$ djlint --profile=jinja --lint KiraTemplates

No files to check! 😢

The command "djlint --profile=jinja --lint KiraTemplates" exited with 0.

0.26s


$ djlint --profile=jinja --lint KiraTemplates/**/*.html

Linting 1/1 files ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 00:00    

KiraTemplates/KiraFolder/KiraFolderTemplate.html

───────────────────────────────────────────────────────────────────────────────

T001 1:0 Variables should be wrapped in a whitespace. {{KIRA_SECOND_VARIAB

Linted 1 file, found 1 error.

The command "djlint --profile=jinja --lint KiraTemplates/**/*.html" exited with 1.

No files to check! in the first case, and no linting KiraTemplates\KiraRootTemplate.html in the second case.

4. Not helped

I tried different glob templates, set current working directory, add ./ before KiraTemplates, add slash before KiraTemplates and after KiraTemplates or KiraFolder. But it didn’t work on the Travis Ubuntu environment for me.

5. Environment

  1. Operating system:

    1. Local — Microsoft Windows [Version 10.0.22621.2134]
    2. Travis — Ubuntu 22.04.3 LTS Jammy Jellyfish
    3. AppVeyor — Windows Server 2019
  2. Python 3.12.0

  3. djLint 1.34.1

Thanks.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant