Uploaded image for project: 'Core Server'
  1. Core Server
  2. SERVER-72867

normalize all text file lines to be EOL-terminated

    • Type: Icon: Improvement Improvement
    • Resolution: Fixed
    • Priority: Icon: Major - P3 Major - P3
    • 7.1.0-rc0
    • Affects Version/s: None
    • Component/s: None
    • Labels:
      None
    • Fully Compatible
    • Service Arch 2023-04-17, Service Arch 2023-05-01, Service Arch 2023-05-15

      We've accumulated a large number of text files over time for which the last line is unterminated. This is something we lint against, and it's a source of churn. We can make a single commit to bulk-fix everything in the repo. Of course, files that are recognized as "binary" by git should be left alone. The appropriate repair can be generated by:

      #!/bin/bash
      find_missing_eol_filter() {
          while read f ; do tail -n 1 "$f" | read _ || echo "$f" ; done
      }
      fix_missing_eol_filter() {
          while read f ; do echo >> "$f" ; done
      }
      generate_text_files_list() {
          git ls-files --eol | grep -v src/third_party | grep '^i/lf' | cut -c 40-
      }
      generate_text_files_list | find_missing_eol_filter | fix_missing_eol_filter
      

      https://gist.github.com/BillyDonahue/976c19b4de7c06a49f57a81ae7642bd4

      (draft) https://github.com/10gen/mongo/pull/9819

            Assignee:
            billy.donahue@mongodb.com Billy Donahue
            Reporter:
            billy.donahue@mongodb.com Billy Donahue
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated:
              Resolved: