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 getAccessKind #398

Merged
merged 6 commits into from
Mar 9, 2024
Merged

feat: add getAccessKind #398

merged 6 commits into from
Mar 9, 2024

Conversation

JoshuaKGoldberg
Copy link
Owner

PR Checklist

Overview

Adds the function, with some rudimentary unit tests.

Copy link

codecov bot commented Feb 21, 2024

Codecov Report

Attention: Patch coverage is 60.09390% with 85 lines in your changes are missing coverage. Please review.

Project coverage is 79.60%. Comparing base (49d5dd0) to head (4f0ccaf).
Report is 1 commits behind head on main.

Files Patch % Lines
src/nodes/access.ts 60.37% 84 Missing ⚠️
src/nodes/index.ts 0.00% 1 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main     #398      +/-   ##
==========================================
- Coverage   80.25%   79.60%   -0.65%     
==========================================
  Files          35       36       +1     
  Lines        6426     6639     +213     
  Branches      360      437      +77     
==========================================
+ Hits         5157     5285     +128     
- Misses       1269     1354      +85     
Flag Coverage Δ
4.3.5 79.39% <60.09%> (-0.64%) ⬇️
4.6.4 79.42% <60.09%> (-0.65%) ⬇️
4.9.5 79.42% <60.09%> (-0.65%) ⬇️
latest 79.39% <60.09%> (-0.64%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

Copy link
Owner Author

Choose a reason for hiding this comment

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

I'll add some more tests 🙂

Copy link
Owner Author

Choose a reason for hiding this comment

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

Added some, ran out of time+energy to add more. Can file a followup issue.

@CHE1RON
Copy link

CHE1RON commented Mar 9, 2024

It would be great to have this (and through this, get isReassignmentTarget) for migrating https://github.com/cartant/eslint-plugin-etc 😉

/**
* What operations(s), if any, an expression applies.
*/
export enum AccessKind {
Copy link
Collaborator

Choose a reason for hiding this comment

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

Could it be better to express these in bitwise notation, to make it clear that's how they are supposed to be used?

export enum AccessKind {
  None = 0,
	Read = 1 << 0,
	Write = 1 << 1,
	Delete = 1 << 2,
	ReadWrite = Read | Write,
}

Copy link
Collaborator

Choose a reason for hiding this comment

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

It's probably a bit unnecessary though.

Copy link
Owner Author

Choose a reason for hiding this comment

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

I like it!

@JoshuaKGoldberg JoshuaKGoldberg merged commit 2f8c76a into main Mar 9, 2024
22 of 23 checks passed
@JoshuaKGoldberg JoshuaKGoldberg deleted the get-access-kind branch March 9, 2024 13:20
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.

🚀 Feature: Add getAccessKind
3 participants