Skip to content

feat: add .pre-commit-config.yaml for vala-lint#312

Open
kuya-carlo wants to merge 1 commit intotoolstack:mainfrom
kuya-carlo:fix/vala-lint-errors
Open

feat: add .pre-commit-config.yaml for vala-lint#312
kuya-carlo wants to merge 1 commit intotoolstack:mainfrom
kuya-carlo:fix/vala-lint-errors

Conversation

@kuya-carlo
Copy link
Copy Markdown

Integrate vala-lint to automate code style checks.

See: https://github.com/vala-lang/vala-lint

Why not use vala-lint pre-commit config as is?

When I tried to use the existing config are having a hard time making it work with less config(see logs below). Since devs do have vala in, its just a few steps if we build and install vala-lint to test in our local machine or to add in the workflows

prek logs [root@8ea5044fa588 Folio]# prek --all-files warning: The following repos have mutable `rev` fields (moving tag / branch): https://github.com/vala-lang/vala-lint: master Mutable references are never updated after first install and are not supported. See https://pre-commit.com/#using-the-latest-version-for-a-repository for more details. hint: `prek auto-update` often fixes this",

Vala-Lint................................................................Failed

  • hook id: vala-lint

  • exit code: 125

    Error: short-name resolution enforced but cannot prompt without a TTY
    Error: short-name resolution enforced but cannot prompt without a TTY
    Error: short-name resolution enforced but cannot prompt without a TTY
    Error: short-name resolution enforced but cannot prompt without a TTY
    Error: short-name resolution enforced but cannot prompt without a TTY
    Error: short-name resolution enforced but cannot prompt without a TTY
    Error: short-name resolution enforced but cannot prompt without a TTY
    Error: short-name resolution enforced but cannot prompt without a TTY

System Info OS: Fedora Linux 43 (Workstation Edition) x86_64 Kernel: Linux 6.19.8-200.fc43.x86_64 Shell: zsh 5.9 DE: GNOME 49.5 WM: Mutter (Wayland) CPU: Intel(R) Core(TM) i5-8350U (8) @ 3.60 GHz GPU: Intel UHD Graphics 620 @ 1.10 GHz [Integrated] Memory: 19.27 GiB

@kuya-carlo kuya-carlo marked this pull request as ready for review March 30, 2026 18:17
@toolstack
Copy link
Copy Markdown
Owner

Thanks for the PR, I'm ok with it in general, there is one change that needs to be made though.

The default vala-lint config is to treat indent tabs as an error, but all of the files in Folio use tabs for indent, and I'm not willing to change that at this time.

To solve that, could you please add a vala-lint config file with use-of-tabs=off in the root and reference it on the command line of the lint check?

Thanks.

@toolstack toolstack added the enhancement New feature or request label Apr 3, 2026
@toolstack toolstack added this to the Next release milestone Apr 3, 2026
@toolstack
Copy link
Copy Markdown
Owner

Two other quick items:

  • both src and lib need to be linted
  • once the changes are made please squash the PR

Thanks.

Integrate vala-lint to automate code style checks.
See: https://github.com/vala-lang/vala-lint

ci: add build and lint workflows

ci: add vala-lint.conf
@kuya-carlo kuya-carlo force-pushed the fix/vala-lint-errors branch from e07d686 to 2def59e Compare April 4, 2026 10:31
@kuya-carlo
Copy link
Copy Markdown
Author

* both src and lib need to be linted

Do you mean... only src and lib is to be linted or include src and lib(and therefore, other folders)?
In any case, the pre-commit fixes fixable errors now, and it doesnt yell about tabs. I didn't fix it in this PR to make this PR clean and separate to the linting process.

* once the changes are made please squash the PR

Done.

@toolstack
Copy link
Copy Markdown
Owner

* both src and lib need to be linted

Do you mean... only src and lib is to be linted or include src and lib(and therefore, other folders)? In any case, the pre-commit fixes fixable errors now, and it doesnt yell about tabs. I didn't fix it in this PR to make this PR clean and separate to the linting process.

In the original change you had io.elementary.vala-lint -c vala-lint.conf --fix src, is see you've changed it to io.elementary.vala-lint -c vala-lint.conf --fix . but it should probably be io.elementary.vala-lint -c vala-lint.conf --fix src lib as those are the only directories with any vala files in them anyway so no extra processing is done for stuff that doesn't need it.

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

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants