-
Notifications
You must be signed in to change notification settings - Fork 111
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
add class-level comments #144
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -2,7 +2,9 @@ | |
# frozen_string_literal: true | ||
|
||
module Packwerk | ||
# A general implementation of a graph data structure with the ability to check for - and list - cycles. | ||
class Graph | ||
# @param [Array<Array>] edges The edges of the graph; An edge being represented as an Array of two nodes. | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Should be we using sorbet? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Yeah, we could use sorbet, that's true - I wanted to keep this PR to comments only so we could more easily merge it. 🤔 Sorbet would make it way more explicit and also be guaranteed to match the code, so definitely better. Will think about doing it later, want to play around with restructuring the code first in a separate PR There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Even if we were using sorbet we should be documenting our methods and parameters. |
||
def initialize(*edges) | ||
@edges = edges.uniq | ||
@cycles = Set.new | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This one feels a little too much like
describe the class name
and I don't think it adds any value.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
yeah I was on the fence about this one, but then thought - does everyone know CLI means command-line interface?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If you have the same doubts as me I should probably remove this one.