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

feat: Add ui5lint-disable directives #327

Merged
merged 14 commits into from
Nov 13, 2024
Merged

feat: Add ui5lint-disable directives #327

merged 14 commits into from
Nov 13, 2024

Conversation

RandomByte
Copy link
Member

@RandomByte RandomByte commented Sep 27, 2024

Sources may contain the following comments to suppress reporting of findings. Both, line and block comments are supported. The comment should contain nothing but the directive, optionally followed by a description (separated using "--").

This should behave similar to ESLint's disable comments.

General syntax:
// ui5lint-disable(-next)(-line) rule-1, rule2 -- Description

Examples:

foo(); // ui5lint-disable-line

// ui5lint-disable-next-line
foo();

// ui5lint-disable no-deprecated-api, no-globals
sap.foo();
// ui5lint-enable no-deprecated-api, no-globals

/* ui5lint-disable-next-line no-deprecated-api --
  To be discussed
*/
foo();

JIRA: CPOUI5FOUNDATION-911

Resolves #268

@RandomByte RandomByte changed the title test: Add fixture for directives feat: Add ui5lint-disable directives Sep 27, 2024
@RandomByte RandomByte force-pushed the add-directives branch 2 times, most recently from 1e3a049 to 8310167 Compare October 9, 2024 08:19
@RandomByte RandomByte force-pushed the add-directives branch 3 times, most recently from 4063044 to 04cf2de Compare October 31, 2024 15:45
@RandomByte RandomByte force-pushed the add-directives branch 5 times, most recently from 80080f3 to d5289b4 Compare November 8, 2024 12:50
@RandomByte RandomByte marked this pull request as ready for review November 8, 2024 12:50
@RandomByte RandomByte requested a review from a team November 8, 2024 12:50
Copy link
Contributor

@d3xter666 d3xter666 left a comment

Choose a reason for hiding this comment

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

LGTM

@d3xter666 d3xter666 requested a review from a team November 8, 2024 13:59
src/linter/ui5Types/directives.ts Outdated Show resolved Hide resolved
src/linter/ui5Types/directives.ts Outdated Show resolved Hide resolved
src/linter/ui5Types/directives.ts Outdated Show resolved Hide resolved
Copy link
Member

@matz3 matz3 left a comment

Choose a reason for hiding this comment

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

LGTM

Copy link
Member

@matz3 matz3 left a comment

Choose a reason for hiding this comment

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

Please enhance the README to document this new feature and explain how to use it.

@RandomByte RandomByte force-pushed the add-directives branch 2 times, most recently from e75219f to 164380f Compare November 11, 2024 16:30
src/linter/LinterContext.ts Outdated Show resolved Hide resolved
src/linter/ui5Types/directives.ts Show resolved Hide resolved
Copy link
Member

@matz3 matz3 left a comment

Choose a reason for hiding this comment

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

LGTM

@matz3 matz3 force-pushed the add-directives branch 3 times, most recently from af635f8 to afb18be Compare November 12, 2024 15:42
@RandomByte RandomByte force-pushed the add-directives branch 3 times, most recently from 43f69ad to 830b097 Compare November 12, 2024 20:23
matz3
matz3 previously approved these changes Nov 13, 2024
RandomByte and others added 11 commits November 13, 2024 09:17
JIRA: CPOUI5FOUNDATION-911
Sources may contain the following comments to suppress reporting of
findings. Both, line and block comments are supported. The comment
should contain nothing but the directive, optionally followed by a
description (separated using "--").

This should behave similar to ESLint's disable comments.

General syntax:
// ui5lint-disable(-next)(-line) rule-1, rule2 -- Description

Examples:
foo(); // ui5lint-disable-line

// ui5lint-disable-next-line
foo();

// ui5lint-disable no-deprecated-api, no-globals
sap.foo();
// ui5lint-enable no-deprecated-api, no-globals

/* ui5lint-disable-next-line no-deprecated-api --
  To be discussed
*/
foo();
This ensures correct behavior when a 'ui5lint-disable-next-line'
directive is spread across multiple lines (multi-line comment), where
the line directly following the comment should be affected.
Co-authored-by: Matthias Oßwald <mat.osswald@sap.com>
matz3
matz3 previously approved these changes Nov 13, 2024
@RandomByte RandomByte requested a review from KlattG November 13, 2024 08:41
@RandomByte
Copy link
Member Author

Copy link
Member

@flovogt flovogt left a comment

Choose a reason for hiding this comment

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

@RandomByte
Copy link
Member Author

@RandomByte could you update the log output https://github.com/SAP/ui5-linter/blob/main/README.md#usage too please?

Done, thanks 👍

Copy link
Contributor

@KlattG KlattG left a comment

Choose a reason for hiding this comment

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

Just some small suggestions, otherwise LG

README.md Outdated Show resolved Hide resolved
README.md Outdated Show resolved Hide resolved
README.md Outdated Show resolved Hide resolved
Co-authored-by: Günter Klatt <57760635+KlattG@users.noreply.github.com>
@RandomByte RandomByte merged commit 3c29e52 into main Nov 13, 2024
13 checks passed
@RandomByte RandomByte deleted the add-directives branch November 13, 2024 15:50
@openui5bot openui5bot mentioned this pull request Nov 13, 2024
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.

Ignore a specific line in code like @ts-ignore
5 participants