Signal-iOS/Scripts
Evan Hahn 370ff654e7
Change license to AGPL
Change license to AGPL

This commit:

- Updates the `LICENSE` file

- Start every file with something like:

      // Copyright YEAR_FIRST_PUBLISHED Signal Messenger, LLC
      // SPDX-License-Identifier: AGPL-3.0-only

---

First, I removed existing license headers with this Ruby 3.1.2 script:

    require 'set'

    EXTENSIONS_TO_CHECK = Set['.h', '.hpp', '.cpp', '.m', '.mm', '.pch', '.swift']

    same = 0
    different = 0

    all_files = `git ls-files`.lines.map { |line| line.strip }
    all_files.each do |relative_path|
      if relative_path == 'Pods'
        next
      end

      unless EXTENSIONS_TO_CHECK.include? File.extname(relative_path)
        next
      end

      path = File.expand_path(relative_path)

      contents = File.read(path)
      new_contents = contents.sub(/\/\/\n\/\/  Copyright .*\n\/\/\n\n/, '')

      if contents == new_contents
        same += 1
      else
        different += 1
      end

      File.write(path, new_contents)
    end

    puts "updated #{different} file(s), left #{same} untouched"

I'm sure this script could be improved, but it worked well enough.

Then, I created `Scripts/lint/lint-license-headers` and ran it to auto-
fix a lot of files. This changed the mode of some files, but I think
that's actually desirable. For example,
`SignalServiceKit/src/Util/AppContext.m` previously had a mode of
`0755/-rwxr-xr-x`, and it's now `0644/-rw-r--r--`.

Then I fixed some stragglers and updated the precommit script.

See [a similar change in the Desktop app][0].

[0]: 8bfaf598af
2022-10-13 08:25:37 -05:00
..
git_hooks Remove reverse integration script 2022-06-10 13:56:32 +00:00
lint Change license to AGPL 2022-10-13 08:25:37 -05:00
sds_codegen Change license to AGPL 2022-10-13 08:25:37 -05:00
translation Fetch translations from Smartling 2022-09-29 16:13:06 -07:00
translation-tool Change license to AGPL 2022-10-13 08:25:37 -05:00
AuditStringH.py More Python 3 script fixes 2022-03-24 10:28:27 -05:00
bump_build_tag.py Scripts: subprocess.check_output should use text=True for compatibility 2022-03-24 17:28:12 -05:00
ClearDerivedData.sh Respond to CR. 2018-02-09 10:31:29 -05:00
debug_log_upload.py Scripts: subprocess.check_output should use text=True for compatibility 2022-03-24 17:28:12 -05:00
disableUniversalDeviceSupport More Python 3 script fixes 2022-03-24 10:28:27 -05:00
emoji_ranges.py Upgrade scripts to Python 3 2022-03-21 12:58:33 -05:00
emoji-data.txt Respond to CR. 2017-10-30 12:11:42 -04:00
EmojiGenerator.swift Change license to AGPL 2022-10-13 08:25:37 -05:00
enableUniversalDeviceSupport More Python 3 script fixes 2022-03-24 10:28:27 -05:00
extract_analytics_event_names.py Move script out of SignalServiceKit 2022-08-01 16:29:43 -05:00
feature_flags_beta.py Upgrade scripts to Python 3 2022-03-21 12:58:33 -05:00
feature_flags_common.py Scripts: subprocess.check_output should use text=True for compatibility 2022-03-24 17:28:12 -05:00
feature_flags_openPreview.py Upgrade scripts to Python 3 2022-03-21 12:58:33 -05:00
feature_flags_production.py Upgrade scripts to Python 3 2022-03-21 12:58:33 -05:00
feature_flags_qa.py Upgrade scripts to Python 3 2022-03-21 12:58:33 -05:00
HardResetGit.sh Hard reset git script. 2017-01-31 13:58:13 -05:00
precommit.py Change license to AGPL 2022-10-13 08:25:37 -05:00
ProtoWrappers.py Change license to AGPL 2022-10-13 08:25:37 -05:00
schema_dump Firm up database schema 2021-11-09 14:25:42 -08:00
set_release_notes set_release_notes: support EDITOR with arguments 2022-05-25 15:59:47 -07:00
setup_private_pods Fix setup_private_pods script for newly-cloned repos 2022-01-28 10:04:00 -08:00
sort-Xcode-project-file Sort the Xcode project's visible files 2022-08-19 15:38:25 -07:00
sqlclient Don't read or write dbPath in debug dbPaypload 2022-09-26 14:13:06 -07:00
sqlclient-legacy sql client scripts 2019-04-05 10:50:45 -06:00
symbolicate.py Pretty-print symbolicated crashes 2022-05-23 22:08:36 +00:00
unused_strings.py Improve script to find unused strings 2022-04-15 15:28:15 -05:00
update_plist_info.sh Fix update_plist_info.sh to not assume no decorate on git log 2022-05-10 19:49:30 -05:00
update_share_plist_info.sh PR Feedback 2019-05-28 13:07:34 -07:00
upload_metadata Harden upload_metadata script 2022-05-05 10:13:47 -05:00