[BACK]Return to line.go CVS log [TXT][DIR] Up to [cvs.NetBSD.org] / pkgsrc / pkgtools / pkglint / files

Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files.

Diff for /pkgsrc/pkgtools/pkglint/files/Attic/line.go between version 1.11 and 1.12

version 1.11, 2016/07/09 09:43:48 version 1.12, 2016/12/04 15:28:36
Line 130  func (line *Line) Errorf(format string, 
Line 130  func (line *Line) Errorf(format string, 
         logs(llError, line.Fname, line.linenos(), format, fmt.Sprintf(format, args...))          logs(llError, line.Fname, line.linenos(), format, fmt.Sprintf(format, args...))
         line.logAutofix()          line.logAutofix()
 }  }
 func (line *Line) Error0(format string)             { line.Errorf(format) }  
 func (line *Line) Error1(format, arg1 string)       { line.Errorf(format, arg1) }  
 func (line *Line) Error2(format, arg1, arg2 string) { line.Errorf(format, arg1, arg2) }  
   
 func (line *Line) Warnf(format string, args ...interface{}) {  func (line *Line) Warnf(format string, args ...interface{}) {
         line.printSource(G.logOut)          line.printSource(G.logOut)
         logs(llWarn, line.Fname, line.linenos(), format, fmt.Sprintf(format, args...))          logs(llWarn, line.Fname, line.linenos(), format, fmt.Sprintf(format, args...))
         line.logAutofix()          line.logAutofix()
 }  }
 func (line *Line) Warn0(format string)             { line.Warnf(format) }  
 func (line *Line) Warn1(format, arg1 string)       { line.Warnf(format, arg1) }  
 func (line *Line) Warn2(format, arg1, arg2 string) { line.Warnf(format, arg1, arg2) }  
   
 func (line *Line) Notef(format string, args ...interface{}) {  func (line *Line) Notef(format string, args ...interface{}) {
         line.printSource(G.logOut)          line.printSource(G.logOut)
         logs(llNote, line.Fname, line.linenos(), format, fmt.Sprintf(format, args...))          logs(llNote, line.Fname, line.linenos(), format, fmt.Sprintf(format, args...))
         line.logAutofix()          line.logAutofix()
 }  }
 func (line *Line) Note0(format string)             { line.Notef(format) }  
 func (line *Line) Note1(format, arg1 string)       { line.Notef(format, arg1) }  
 func (line *Line) Note2(format, arg1, arg2 string) { line.Notef(format, arg1, arg2) }  
   
 func (line *Line) String() string {  func (line *Line) String() string {
         return line.Fname + ":" + line.linenos() + ": " + line.Text          return line.Fname + ":" + line.linenos() + ": " + line.Text
Line 251  func (line *Line) CheckAbsolutePathname(
Line 242  func (line *Line) CheckAbsolutePathname(
 func (line *Line) CheckLength(maxlength int) {  func (line *Line) CheckLength(maxlength int) {
         if len(line.Text) > maxlength {          if len(line.Text) > maxlength {
                 line.Warnf("Line too long (should be no more than %d characters).", maxlength)                  line.Warnf("Line too long (should be no more than %d characters).", maxlength)
                 Explain3(                  Explain(
                         "Back in the old time, terminals with 80x25 characters were common.",                          "Back in the old time, terminals with 80x25 characters were common.",
                         "And this is still the default size of many terminal emulators.",                          "And this is still the default size of many terminal emulators.",
                         "Moderately short lines also make reading easier.")                          "Moderately short lines also make reading easier.")
Line 265  func (line *Line) CheckValidCharacters(r
Line 256  func (line *Line) CheckValidCharacters(r
                 for _, c := range rest {                  for _, c := range rest {
                         uni += fmt.Sprintf(" %U", c)                          uni += fmt.Sprintf(" %U", c)
                 }                  }
                 line.Warn1("Line contains invalid characters (%s).", uni[1:])                  line.Warnf("Line contains invalid characters (%s).", uni[1:])
         }          }
 }  }
   
 func (line *Line) CheckTrailingWhitespace() {  func (line *Line) CheckTrailingWhitespace() {
         if hasSuffix(line.Text, " ") || hasSuffix(line.Text, "\t") {          if hasSuffix(line.Text, " ") || hasSuffix(line.Text, "\t") {
                 if !line.AutofixReplaceRegexp(`\s+\n$`, "\n") {                  if !line.AutofixReplaceRegexp(`\s+\n$`, "\n") {
                         line.Note0("Trailing white-space.")                          line.Notef("Trailing white-space.")
                         Explain2(                          Explain(
                                 "When a line ends with some white-space, that space is in most cases",                                  "When a line ends with some white-space, that space is in most cases",
                                 "irrelevant and can be removed.")                                  "irrelevant and can be removed.")
                 }                  }
Line 290  func (line *Line) CheckRcsid(prefixRe Re
Line 281  func (line *Line) CheckRcsid(prefixRe Re
         }          }
   
         if !line.AutofixInsertBefore(suggestedPrefix + "$" + "NetBSD$") {          if !line.AutofixInsertBefore(suggestedPrefix + "$" + "NetBSD$") {
                 line.Error1("Expected %q.", suggestedPrefix+"$"+"NetBSD$")                  line.Errorf("Expected %q.", suggestedPrefix+"$"+"NetBSD$")
                 Explain3(                  Explain(
                         "Several files in pkgsrc must contain the CVS Id, so that their",                          "Several files in pkgsrc must contain the CVS Id, so that their",
                         "current version can be traced back later from a binary package.",                          "current version can be traced back later from a binary package.",
                         "This is to ensure reproducible builds, for example for finding bugs.")                          "This is to ensure reproducible builds, for example for finding bugs.")

Legend:
Removed from v.1.11  
changed lines
  Added in v.1.12

CVSweb <webmaster@jp.NetBSD.org>