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

Pedantic commit #849

Merged
merged 2 commits into from
Feb 11, 2018
Merged

Pedantic commit #849

merged 2 commits into from
Feb 11, 2018

Conversation

stoivo
Copy link
Member

@stoivo stoivo commented Feb 4, 2018

  • The ruler appears when you are on those lines
  • If the lines are too long they will be marked with the scope invalid.deprecated.line-too-long.git-commit where invalid is the same scope as SublimeLinter uses to is should be coverd by all Themes

fix #41
fix #423

@stoivo stoivo force-pushed the pedantic_commit branch 2 times, most recently from 9749402 to 91109f8 Compare February 4, 2018 02:23
Copy link
Collaborator

@randy3k randy3k left a comment

Choose a reason for hiding this comment

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

Nice job

@@ -14,5 +14,4 @@
"gutter": true,
"line_numbers": true,
"word_wrap": true,
Copy link
Collaborator

Choose a reason for hiding this comment

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

remove the ending comma

@stoivo
Copy link
Member Author

stoivo commented Feb 10, 2018

Thanks. I think this is a sensible default. And if anyone hates it. They can change it or turn it of.

Copy link
Member

@asfaltboy asfaltboy left a comment

Choose a reason for hiding this comment

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

Other than a few "pedantic" notes, this looks good to me!

self.view = view
self.first_line_limit = savvy_settings.get('pedantic_commit_first_line_length')
self.body_line_limit = savvy_settings.get('pedantic_commit_message_line_length')
self.warrning_size = savvy_settings.get('pedantic_commit_warning_length')
Copy link
Member

Choose a reason for hiding this comment

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

Typo in warrning_size; should this be warning_size, or even warning_length ?

Copy link
Member Author

Choose a reason for hiding this comment

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

yes


first_line = self.view.lines(sublime.Region(0,0))[0]
length = first_line.b - first_line.a
if self.first_line_limit < length:
Copy link
Member

Choose a reason for hiding this comment

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

I think the condition is clearer like this:

if length > self.first_line_limit:

if self.first_line_limit < length:
warning_lines.append(sublime.Region(
first_line.a + self.first_line_limit,
min(first_line.a+self.first_line_limit+self.warrning_size, first_line.b)))
Copy link
Member

Choose a reason for hiding this comment

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

I get vexed by the inconsistent spacing around the plus (+) operator... can we please always have space on either side of plusses?

@asfaltboy asfaltboy merged commit 06b1e7f into dev Feb 11, 2018
@stoivo stoivo deleted the pedantic_commit branch February 11, 2018 10:24
@stoivo
Copy link
Member Author

stoivo commented Feb 11, 2018

Thanks. I will try to finish #813

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.

3 participants