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

Configure YAML linting (OSOE-759) #658

Closed
3 tasks done
Piedone opened this issue Dec 29, 2023 · 7 comments · Fixed by #805
Closed
3 tasks done

Configure YAML linting (OSOE-759) #658

Piedone opened this issue Dec 29, 2023 · 7 comments · Fixed by #805
Assignees

Comments

@Piedone
Copy link
Member

Piedone commented Dec 29, 2023

After Lombiq/NodeJs-Extensions#11, configure the YAML linting rules of yamllint as it's fitting for our projects.

quoted-strings: {
    quote-type: single,
    required: only-when-needed
}

Jira issue

@github-actions github-actions bot changed the title Configure YAML linting Configure YAML linting (OSOE-759) Dec 29, 2023
@DemeSzabolcs DemeSzabolcs self-assigned this Jul 3, 2024
@DemeSzabolcs
Copy link
Member

DemeSzabolcs commented Jul 3, 2024

Regarding the rules I have one (currently), that I can't decide:

Should we allow implicit null values?

Example for implicit null: https://github.com/Lombiq/GitHub-Actions/blob/dev/.github/workflows/deploy-orchard1-to-azure-app-service.yml#L42C7-L43
Explicit would be: explicitly-null: null

@BenedekFarkas
Copy link
Member

I would allow it and seeing the linked example, I'd rather enforce an explicit null in this case (if it plays nicely with GitHub Actions), because whitespace (or lack thereof) should not have syntactical meaning (unless https://en.wikipedia.org/wiki/Whitespace_%28programming_language%29 :D), but YAML is a language where indentation has syntactical meaning, so it's sort of a contradiction.

@Piedone
Copy link
Member Author

Piedone commented Jul 3, 2024

Are there any similar examples? Because MAINTENANCE_USER_NAME and MAINTENANCE_PASSWORD should actually have at least a description like the others and mustn't be simply set to null. So, unless there's something markedly different then these, let's enforce explicit nulls and fix these by providing proper values.

@DemeSzabolcs
Copy link
Member

So, unless there's something markedly different then these, let's enforce explicit nulls and fix these by providing proper values.

Well there is actually an interesting scenario, in case of

on:
  pull-request:
  push:
    branches:
      - dev

(https://github.com/Lombiq/GitHub-Actions/blob/dev/.github/workflows/validate-this-gha-refs.yml#L6)

The pull-request: line will trigger the warning. We can fix these too by adding null and it will still work, so:

on:
  pull-request: null
  push:
    branches:
      - dev

Do we want to use the rule still?

@Piedone
Copy link
Member Author

Piedone commented Jul 4, 2024

Then not, but still fix the two maintenance secrets.

@DemeSzabolcs
Copy link
Member

Add the workflow to https://github.com/Lombiq/Hosting-Media-Theme too.

Is this necessary? The workflow in OSOCE (https://github.com/Lombiq/Open-Source-Orchard-Core-Extensions/blob/dev/.github/workflows/build-and-test.yml#L73-L78) checks the submodules too. I already fixed the warnings in them.

@Piedone
Copy link
Member Author

Piedone commented Jul 6, 2024

Then no, not necessary.

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

Successfully merging a pull request may close this issue.

3 participants