Skip to content

Refactored linting code and fixed issues#45

Open
olehermanse wants to merge 8 commits intocfengine:mainfrom
olehermanse:rebase
Open

Refactored linting code and fixed issues#45
olehermanse wants to merge 8 commits intocfengine:mainfrom
olehermanse:rebase

Conversation

@olehermanse
Copy link
Copy Markdown
Member

@olehermanse olehermanse commented Apr 3, 2026

Almost a complete rewrite.

It had a few issues:

  • Finding user defined bodies / bundles / promise types did not work when specifying file instead of folder.
  • Code paths for linting arg, vs file, vs folder, vs snippet were getting complicated and confusing.
  • Linting rules (node checks) and state changes were getting complicated.
    I wanted to simplify these before we add more rules.
  • Probably some other issues I cannot remember.

Fixing the issues was not trivial, so I decided to refactor and fix at the same time.

Signed-off-by: Ole Herman Schumacher Elgesem <ole@northern.tech>
Signed-off-by: Ole Herman Schumacher Elgesem <ole@northern.tech>
… tests

Signed-off-by: Ole Herman Schumacher Elgesem <ole@northern.tech>
Signed-off-by: Ole Herman Schumacher Elgesem <ole@northern.tech>
@olehermanse olehermanse force-pushed the rebase branch 2 times, most recently from 197c3de to dd743a1 Compare April 3, 2026 17:54
@olehermanse olehermanse changed the title Refactored linting code i2 Refactored linting code and fixed issues Apr 3, 2026
@olehermanse olehermanse marked this pull request as ready for review April 3, 2026 20:34
@olehermanse olehermanse requested a review from larsewi April 3, 2026 20:34
Copy link
Copy Markdown
Contributor

@craigcomstock craigcomstock left a comment

Choose a reason for hiding this comment

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

looked at everything but the last big commit. Looks good so far!

Signed-off-by: Ole Herman Schumacher Elgesem <ole@northern.tech>
Signed-off-by: Ole Herman Schumacher Elgesem <ole@northern.tech>
Signed-off-by: Ole Herman Schumacher Elgesem <ole@northern.tech>
Almost a complete rewrite.

It had a few issues:
- Finding user defined bodies / bundles / promise types did not work when specifying file instead of folder.
- Code paths for linting arg, vs file, vs folder, vs snippet were getting complicated and confusing.
- Linting rules (node checks) and state changes were getting complicated.
  I wanted to simplify these before we add more rules.
- Probably some other issues I cannot remember.

Fixing the issues was not trivial, so I decided to refactor and fix at the same time.

Signed-off-by: Ole Herman Schumacher Elgesem <ole@northern.tech>
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.

2 participants