Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

refactor(gitlab): simplify allow_publish function #41

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

Merged

Conversation

@ercanucan
Copy link
Collaborator

@ercanucan ercanucan commented Aug 14, 2018

This PR simplifies the allow_publish by keeping the same functionality.
Removes unnecessary over-nesting and minor code duplication.
Makes minor white-space arrangements.

This PR simplifies the allow_publish by keeping the same functionality.
Removes unnecessary over-nesting and minor code duplication.
Makes minor white-space arrangements.

allow_access(user: RemoteUser, _package: VerdaccioGitlabPackageAccess, cb: Callback) {
if (!_package.gitlab) {return cb();}
if (!_package.gitlab) return cb();
Copy link
Collaborator

Choose a reason for hiding this comment

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

I'm not the decider of the style, but I would always keep braces in ifs, even in a single line, more maintanable option.

juanpicado reacted with thumbs up emoji
Copy link
Collaborator Author

@ercanucan ercanucan Aug 14, 2018

Choose a reason for hiding this comment

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

We have been using this style in other projects. However I am also okay to bring it back if you both prefer that way.

Copy link
Collaborator

@dlouzan dlouzan left a comment

Choose a reason for hiding this comment

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

Cool contribution, automated testing (where I'm working right now) would make this safer :-)


allow_publish(user: RemoteUser, _package: VerdaccioGitlabPackageAccess, cb: Callback) {
if (!_package.gitlab) {return cb();}
if (!_package.gitlab) return cb();
Copy link
Collaborator

Choose a reason for hiding this comment

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

Same as above

Copy link
Owner

@bufferoverflow bufferoverflow left a comment

Choose a reason for hiding this comment

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

I like this simplification!

@bufferoverflow bufferoverflow merged commit ac6ccd0 into bufferoverflow:master Aug 15, 2018
@ercanucan ercanucan deleted the refactor/allow_publish branch August 16, 2018 07:50
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Reviewers

@dlouzan dlouzan dlouzan approved these changes

@bufferoverflow bufferoverflow bufferoverflow approved these changes

Assignees

No one assigned

Labels

None yet

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

AltStyle によって変換されたページ (->オリジナル) /