Skip to content

feat: add getAccessKind#398

Merged
JoshuaKGoldberg merged 6 commits into
mainfrom
get-access-kind
Mar 9, 2024
Merged

feat: add getAccessKind#398
JoshuaKGoldberg merged 6 commits into
mainfrom
get-access-kind

Conversation

@JoshuaKGoldberg

Copy link
Copy Markdown
Owner

PR Checklist

Overview

Adds the function, with some rudimentary unit tests.

@codecov

codecov Bot commented Feb 21, 2024

Copy link
Copy Markdown

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.

Comment thread src/nodes/access.test.ts

Copy link
Copy Markdown
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
Copy Markdown
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.

@ghost

ghost commented Mar 9, 2024

Copy link
Copy Markdown

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

Comment thread src/nodes/access.ts
/**
* What operations(s), if any, an expression applies.
*/
export enum AccessKind {

Copy link
Copy Markdown
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
Copy Markdown
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
Copy Markdown
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
@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

2 participants