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

ci(yamllint): add YAML linting (#838) #838

Open
wants to merge 6 commits into
base: master
Choose a base branch
from

Conversation

jlemesh
Copy link
Member

@jlemesh jlemesh commented Oct 10, 2024

Related to #836

Add YAML linting for all files except Helm chart files, which are linted by helm lint and ct lint (yamllint does not understand templating language and fails with invalid syntax errors).Update values-dev.yaml file to pass linter checks.

Add .editorconfig file with rules for various files. Adding also .go as I remember we were talking that it would be good if the file could be used everywhere, we'll be able to copypaste it to other repositories and there will be no need for changes if new files are introduced to the repository. Let me know if it is better to only add config only for the files that currently exist in the repository.

For markdownlint, some rules were disabled because there will be to many changes to existing files (e. g. line length). Some rules do not work due to some specific contents in files, e. g. we have cron schedule defined (* * * * *) and markdownlint thinks this is emphasis (bold) and throws warning that there is a space between emphasis asterisks.

Copy link

codecov bot commented Oct 10, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 31.06%. Comparing base (d81a814) to head (430e2e4).

Additional details and impacted files

Impacted file tree graph

@@           Coverage Diff           @@
##           master     #838   +/-   ##
=======================================
  Coverage   31.06%   31.06%           
=======================================
  Files          26       26           
  Lines        2488     2488           
=======================================
  Hits          773      773           
  Misses       1715     1715           

jlemesh added a commit to jlemesh/reana that referenced this pull request Oct 10, 2024
@jlemesh jlemesh force-pushed the feature_add_yaml_and_md_linting branch from e2b0493 to 788d644 Compare October 10, 2024 12:41
.editorconfig Outdated Show resolved Hide resolved
@jlemesh jlemesh changed the title ci(yamllint): add YAML linting (#836) ci(yamllint): add YAML linting (#838) Oct 15, 2024
jlemesh added a commit to jlemesh/reana that referenced this pull request Oct 15, 2024
@jlemesh jlemesh force-pushed the feature_add_yaml_and_md_linting branch from 788d644 to 97b0a62 Compare October 15, 2024 14:58
jlemesh added a commit to jlemesh/reana that referenced this pull request Oct 15, 2024
jlemesh added a commit to jlemesh/reana that referenced this pull request Oct 17, 2024
jlemesh added a commit to jlemesh/reana that referenced this pull request Oct 18, 2024
@jlemesh jlemesh force-pushed the feature_add_yaml_and_md_linting branch from 521553e to d4df666 Compare October 18, 2024 07:38
.editorconfig Outdated
[Dockerfile]
indent_size = 4

[*.md]
Copy link
Member

Choose a reason for hiding this comment

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

I'll take out the editorconfig because some of the values are not compatible with prettier etc code formatters. I'll introduce prettier style checks later on.

run-tests.sh Outdated
}

check_markdownlint () {
markdownlint-cli2 .
Copy link
Member

Choose a reason for hiding this comment

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

Better say markdownlint-cli2 "**/*.md" here which will catch more files.

# MD013/line-length : Line length : https://github.com/DavidAnson/markdownlint/blob/v0.35.0/doc/md013.md
MD013: false

# MD037/no-space-in-emphasis : Spaces inside emphasis markers : https://github.com/DavidAnson/markdownlint/blob/v0.35.0/doc/md037.md
Copy link
Member

Choose a reason for hiding this comment

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

Some of these checks are not necessary as they would catch only a handful of cases. I'll amend the sources and remove them and repush.

tiborsimko pushed a commit to jlemesh/reana that referenced this pull request Nov 13, 2024
tiborsimko added a commit to jlemesh/reana that referenced this pull request Nov 13, 2024
@tiborsimko tiborsimko force-pushed the feature_add_yaml_and_md_linting branch from d4df666 to a808a4e Compare November 13, 2024 16:26
tiborsimko pushed a commit to jlemesh/reana that referenced this pull request Nov 13, 2024
tiborsimko added a commit to jlemesh/reana that referenced this pull request Nov 13, 2024
tiborsimko added a commit to jlemesh/reana that referenced this pull request Nov 13, 2024
tiborsimko added a commit to jlemesh/reana that referenced this pull request Nov 13, 2024
Also adds basic `.editorconfig` configuration for various languages
since this is the primary way how to configure `shfmt` shell script
source code formatting with respect to indentation.

Closes reanahub#836
@tiborsimko tiborsimko force-pushed the feature_add_yaml_and_md_linting branch from a808a4e to df67510 Compare November 13, 2024 17:45
tiborsimko added a commit to jlemesh/reana that referenced this pull request Nov 13, 2024
tiborsimko added a commit to jlemesh/reana that referenced this pull request Nov 13, 2024
Also adds basic `.editorconfig` configuration for various languages
since this is the primary way how to configure `shfmt` shell script
source code formatting with respect to indentation.

Closes reanahub#836
@tiborsimko tiborsimko force-pushed the feature_add_yaml_and_md_linting branch from df67510 to 8e3c97e Compare November 13, 2024 17:49
tiborsimko added a commit to jlemesh/reana that referenced this pull request Nov 13, 2024
Also adds basic `.editorconfig` configuration for various languages
since this is the primary way how to configure `shfmt` shell script
source code formatting with respect to indentation.

Closes reanahub#836
@tiborsimko tiborsimko force-pushed the feature_add_yaml_and_md_linting branch 4 times, most recently from da20d10 to 43f8cb1 Compare November 13, 2024 18:22
tiborsimko added a commit to jlemesh/reana that referenced this pull request Nov 14, 2024
@tiborsimko tiborsimko force-pushed the feature_add_yaml_and_md_linting branch from 43f8cb1 to 227cd30 Compare November 14, 2024 08:46
tiborsimko added a commit to jlemesh/reana that referenced this pull request Nov 14, 2024
tiborsimko added a commit to jlemesh/reana that referenced this pull request Nov 14, 2024
tiborsimko added a commit to jlemesh/reana that referenced this pull request Nov 14, 2024
Also adds basic `.editorconfig` configuration for various languages
since this is the primary way how to configure `shfmt` shell script
source code formatting with respect to indentation.

Closes reanahub#836
tiborsimko added a commit to jlemesh/reana that referenced this pull request Nov 14, 2024
@tiborsimko tiborsimko force-pushed the feature_add_yaml_and_md_linting branch from 227cd30 to 47ffab1 Compare November 14, 2024 11:05
tiborsimko added a commit to jlemesh/reana that referenced this pull request Nov 14, 2024
tiborsimko added a commit to jlemesh/reana that referenced this pull request Nov 14, 2024
Also adds basic `.editorconfig` configuration for various languages
since this is the primary way how to configure `shfmt` shell script
source code formatting with respect to indentation.

Closes reanahub#836
tiborsimko added a commit to jlemesh/reana that referenced this pull request Nov 14, 2024
@tiborsimko tiborsimko force-pushed the feature_add_yaml_and_md_linting branch from 47ffab1 to 514412e Compare November 14, 2024 16:12
Also adds basic `.editorconfig` configuration for various languages
since this is the primary way how to configure `shfmt` shell script
source code formatting with respect to indentation.

Closes reanahub#836
tiborsimko added a commit to jlemesh/reana that referenced this pull request Nov 14, 2024
@tiborsimko tiborsimko force-pushed the feature_add_yaml_and_md_linting branch from 514412e to 8f4c9ff Compare November 14, 2024 16:40
tiborsimko added a commit to jlemesh/reana that referenced this pull request Nov 14, 2024
In addition to adding JSON linting, orders all the GitHub CI checks
alphabetically.

Closes reanahub#836
@tiborsimko tiborsimko force-pushed the feature_add_yaml_and_md_linting branch from 8f4c9ff to 456fae3 Compare November 14, 2024 16:55
In addition to adding JSON linting, this commit orders all GitHub CI
checks alphabetically.

Closes reanahub#836
@tiborsimko tiborsimko force-pushed the feature_add_yaml_and_md_linting branch from 456fae3 to 430e2e4 Compare November 15, 2024 07:32
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 this pull request may close these issues.

2 participants