summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAdam Kocoloski <kocolosk@apache.org>2022-02-01 11:12:08 -0500
committerGitHub <noreply@github.com>2022-02-01 11:12:08 -0500
commit76fb5b96484f369ca81d524f1a06fea151fd4a4c (patch)
treeedd8e7e9bc8c69c372e1c23dd5dcfbc8b7a25162
parentbef78388a4156260c157075bee5bd062fa6cf4bf (diff)
downloadcouchdb-76fb5b96484f369ca81d524f1a06fea151fd4a4c.tar.gz
Random bits of cleanup (#3914)
* Remove emilio-related Python script The Emilio style checker was removed in #3674. * Remove unused scripts from autotools days * Update credo to support Elixir v1.12 * Ensure the bin directory sticks around
-rw-r--r--bin/.keep1
-rw-r--r--bin/erlang-version.escript3
-rwxr-xr-xbin/warnings_in_scope125
-rwxr-xr-xbuild-aux/dist-error28
-rwxr-xr-xbuild-aux/sphinx-build34
-rwxr-xr-xbuild-aux/sphinx-touch24
-rw-r--r--mix.lock4
7 files changed, 3 insertions, 216 deletions
diff --git a/bin/.keep b/bin/.keep
new file mode 100644
index 000000000..ae3b7026e
--- /dev/null
+++ b/bin/.keep
@@ -0,0 +1 @@
+The build system expects to drop `rebar`, `rebar3` and `erlfmt` in here, and doesn't try to create the directory first.
diff --git a/bin/erlang-version.escript b/bin/erlang-version.escript
deleted file mode 100644
index 66aae1c41..000000000
--- a/bin/erlang-version.escript
+++ /dev/null
@@ -1,3 +0,0 @@
-
-main(_) ->
- io:format("~s~n", [erlang:system_info(otp_release)]).
diff --git a/bin/warnings_in_scope b/bin/warnings_in_scope
deleted file mode 100755
index 2a854211a..000000000
--- a/bin/warnings_in_scope
+++ /dev/null
@@ -1,125 +0,0 @@
-#!/usr/bin/env python3
-import os
-import subprocess
-from pathlib import Path
-import optparse
-import sys
-import re
-
-def run(command, cwd=None):
- try:
- return subprocess.Popen(
- command, shell=True, cwd=cwd,
- stdout=subprocess.PIPE,
- stderr=subprocess.PIPE)
- except OSError as err:
- raise OSError("Error in command '{0}': {1}".format(command, err))
-
-def parse_location(line):
- # take substring between @@
- # take second part of it
- location = line.split(b'@@')[1].strip().split(b' ')[1]
- tokens = location.split(b',')
- if len(tokens) == 1:
- return (int(tokens[0][1:]), 1)
- elif len(tokens) == 2:
- return (int(tokens[0][1:]), int(tokens[1]))
-
-def changed_files(directory, scope):
- result = {}
- proc = run('git diff --no-prefix --unified={0}'.format(scope), cwd=str(directory))
- file_path = None
- for line in iter(proc.stdout.readline, b''):
- if line.startswith(b'diff --git '):
- # this would be problematic if directory has space in the name
- file_name = line.split(b' ')[3].strip()
- file_path = str(directory.joinpath(str(file_name, 'utf-8')))
- result[file_path] = set()
- continue
- if line.startswith(b'@@'):
- start_pos, number_of_lines = parse_location(line)
- for line_number in range(start_pos, start_pos + number_of_lines):
- result[file_path].add(line_number)
- return result
-
-def print_changed(file_name, line_number):
- print('{0}:{1}'.format(str(file_name), str(line_number)))
-
-def changes(dirs, scope):
- result = {}
- for directory in dirs:
- result.update(changed_files(directory, scope))
- return result
-
-def repositories(root):
- for directory in Path(root).rglob('.git'):
- if not directory.is_dir():
- continue
- yield directory.parent
-
-def setup_argparse():
- parser = optparse.OptionParser(description="Filter output to remove unrelated warning")
- parser.add_option(
- "-r",
- "--regexp",
- dest="regexp",
- default='(?P<file_name>[^:]+):(?P<line>\d+).*',
- help="Regexp used to extract file_name and line number",
- )
- parser.add_option(
- "-s",
- "--scope",
- dest="scope",
- default=0,
- help="Number of lines surrounding the change we consider relevant",
- )
- parser.add_option(
- "-p",
- "--print-only",
- action="store_true",
- dest="print_only",
- default=False,
- help="Print changed lines only",
- )
- return parser.parse_args()
-
-def filter_stdin(regexp, changes):
- any_matches = False
- for line in iter(sys.stdin.readline, ''):
- matches = re.match(regexp, line)
- if matches:
- file_name = matches.group('file_name')
- line_number = int(matches.group('line'))
- if file_name in changes and line_number in changes[file_name]:
- print(line, end='')
- any_matches = True
- return any_matches
-
-def validate_regexp(regexp):
- index = regexp.groupindex
- if 'file_name' in index and 'line' in index:
- return True
- else:
- raise TypeError("Regexp must define following groups:\n - file_name\n - line")
-
-def main():
- opts, args = setup_argparse()
- if opts.print_only:
- for file_name, changed_lines in changes(repositories('.'), opts.scope).items():
- for line_number in changed_lines:
- print_changed(file_name, line_number)
- return 0
- else:
- regexp = re.compile(opts.regexp)
- validate_regexp(regexp)
- if filter_stdin(regexp, changes(repositories('.'), opts.scope)):
- return 1
- else:
- return 0
-
-if __name__ == "__main__":
- try:
- sys.exit(main())
- except KeyboardInterrupt:
- pass
-
diff --git a/build-aux/dist-error b/build-aux/dist-error
deleted file mode 100755
index 73486b5db..000000000
--- a/build-aux/dist-error
+++ /dev/null
@@ -1,28 +0,0 @@
-#!/bin/sh -e
-
-# Licensed under the Apache License, Version 2.0 (the "License"); you may not
-# use this file except in compliance with the License. You may obtain a copy of
-# the License at
-#
-# http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing, software
-# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
-# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
-# License for the specific language governing permissions and limitations under
-# the License.
-
-# This script is called by the build system and is used to provide an error
-# about missing or empty files. Some files are optional, and will be built when
-# the environment allows. But these files are required for distribution.
-
-cat << EOF
-ERROR: This file is missing or incomplete:
-
- $1
-
- This file is optional at build and install time,
- but is required when preparing a distribution.
-EOF
-
-exit 1
diff --git a/build-aux/sphinx-build b/build-aux/sphinx-build
deleted file mode 100755
index 8ecf43a55..000000000
--- a/build-aux/sphinx-build
+++ /dev/null
@@ -1,34 +0,0 @@
-#!/bin/sh -e
-
-# Licensed under the Apache License, Version 2.0 (the "License"); you may not
-# use this file except in compliance with the License. You may obtain a copy of
-# the License at
-#
-# http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing, software
-# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
-# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
-# License for the specific language governing permissions and limitations under
-# the License.
-
-# This script is called by the build system and is used to call sphinx-build if
-# is is available, or alternatively, emit a warning, and perform a no-op. Any
-# required directories or Makefiles are created and stubbed out as appropriate.
-
-if test -z "`which sphinx-build`"; then
- missing=yes
- cat << EOF
-WARNING: 'sphinx-build' is needed, and is missing on your system.
- You might have modified some files without having the
- proper tools for further handling them.
-EOF
-fi
-
-if test "$2" = "html"; then
- if test "$missing" != "yes"; then
- sphinx-build $*
- else
- mkdir -p html
- fi
-fi
diff --git a/build-aux/sphinx-touch b/build-aux/sphinx-touch
deleted file mode 100755
index ed7217de2..000000000
--- a/build-aux/sphinx-touch
+++ /dev/null
@@ -1,24 +0,0 @@
-#!/bin/sh -e
-
-# Licensed under the Apache License, Version 2.0 (the "License"); you may not
-# use this file except in compliance with the License. You may obtain a copy of
-# the License at
-#
-# http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing, software
-# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
-# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
-# License for the specific language governing permissions and limitations under
-# the License.
-
-# This script is called by the build system and is used to touch the list of
-# expected output files when sphinx-build is not available. If the files exist,
-# this will satisfy make. If they do not exist, we create of empty files.
-
-if test -z "`which sphinx-build`"; then
- for file in $*; do
- mkdir -p `dirname $file`
- touch $file
- done
-fi \ No newline at end of file
diff --git a/mix.lock b/mix.lock
index 505d7f22e..48e7c719f 100644
--- a/mix.lock
+++ b/mix.lock
@@ -1,14 +1,14 @@
%{
"bunt": {:hex, :bunt, "0.2.0", "951c6e801e8b1d2cbe58ebbd3e616a869061ddadcc4863d0a2182541acae9a38", [:mix], [], "hexpm", "7af5c7e09fe1d40f76c8e4f9dd2be7cebd83909f31fee7cd0e9eadc567da8353"},
"certifi": {:hex, :certifi, "2.5.1", "867ce347f7c7d78563450a18a6a28a8090331e77fa02380b4a21962a65d36ee5", [:rebar3], [{:parse_trans, "~>3.3", [hex: :parse_trans, repo: "hexpm", optional: false]}], "hexpm", "805abd97539caf89ec6d4732c91e62ba9da0cda51ac462380bbd28ee697a8c42"},
- "credo": {:hex, :credo, "1.5.4", "9914180105b438e378e94a844ec3a5088ae5875626fc945b7c1462b41afc3198", [:mix], [{:bunt, "~> 0.2.0", [hex: :bunt, repo: "hexpm", optional: false]}, {:file_system, "~> 0.2.8", [hex: :file_system, repo: "hexpm", optional: false]}, {:jason, "~> 1.0", [hex: :jason, repo: "hexpm", optional: false]}], "hexpm", "cf51af45eadc0a3f39ba13b56fdac415c91b34f7b7533a13dc13550277141bc4"},
+ "credo": {:hex, :credo, "1.5.6", "e04cc0fdc236fefbb578e0c04bd01a471081616e741d386909e527ac146016c6", [:mix], [{:bunt, "~> 0.2.0", [hex: :bunt, repo: "hexpm", optional: false]}, {:file_system, "~> 0.2.8", [hex: :file_system, repo: "hexpm", optional: false]}, {:jason, "~> 1.0", [hex: :jason, repo: "hexpm", optional: false]}], "hexpm", "4b52a3e558bd64e30de62a648518a5ea2b6e3e5d2b164ef5296244753fc7eb17"},
"excoveralls": {:hex, :excoveralls, "0.12.1", "a553c59f6850d0aff3770e4729515762ba7c8e41eedde03208182a8dc9d0ce07", [:mix], [{:hackney, "~> 1.0", [hex: :hackney, repo: "hexpm", optional: false]}, {:jason, "~> 1.0", [hex: :jason, repo: "hexpm", optional: false]}], "hexpm", "5c1f717066a299b1b732249e736c5da96bb4120d1e55dc2e6f442d251e18a812"},
"file_system": {:hex, :file_system, "0.2.10", "fb082005a9cd1711c05b5248710f8826b02d7d1784e7c3451f9c1231d4fc162d", [:mix], [], "hexpm", "41195edbfb562a593726eda3b3e8b103a309b733ad25f3d642ba49696bf715dc"},
"hackney": {:hex, :hackney, "1.15.2", "07e33c794f8f8964ee86cebec1a8ed88db5070e52e904b8f12209773c1036085", [:rebar3], [{:certifi, "2.5.1", [hex: :certifi, repo: "hexpm", optional: false]}, {:idna, "6.0.0", [hex: :idna, repo: "hexpm", optional: false]}, {:metrics, "1.0.1", [hex: :metrics, repo: "hexpm", optional: false]}, {:mimerl, "~>1.1", [hex: :mimerl, repo: "hexpm", optional: false]}, {:ssl_verify_fun, "1.1.5", [hex: :ssl_verify_fun, repo: "hexpm", optional: false]}], "hexpm", "e0100f8ef7d1124222c11ad362c857d3df7cb5f4204054f9f0f4a728666591fc"},
"httpotion": {:hex, :httpotion, "3.1.3", "fdaf1e16b9318dcb722de57e75ac368c93d4c6e3c9125f93e960f953a750fb77", [:mix], [{:ibrowse, "== 4.4.0", [hex: :ibrowse, repo: "hexpm", optional: false]}], "hexpm", "e420172ef697a0f1f4dc40f89a319d5a3aad90ec51fa424f08c115f04192ae43"},
"ibrowse": {:hex, :ibrowse, "4.4.0", "2d923325efe0d2cb09b9c6a047b2835a5eda69d8a47ed6ff8bc03628b764e991", [:rebar3], [], "hexpm"},
"idna": {:hex, :idna, "6.0.0", "689c46cbcdf3524c44d5f3dde8001f364cd7608a99556d8fbd8239a5798d4c10", [:rebar3], [{:unicode_util_compat, "0.4.1", [hex: :unicode_util_compat, repo: "hexpm", optional: false]}], "hexpm", "4bdd305eb64e18b0273864920695cb18d7a2021f31a11b9c5fbcd9a253f936e2"},
- "jason": {:hex, :jason, "1.2.2", "ba43e3f2709fd1aa1dce90aaabfd039d000469c05c56f0b8e31978e03fa39052", [:mix], [{:decimal, "~> 1.0 or ~> 2.0", [hex: :decimal, repo: "hexpm", optional: true]}], "hexpm", "18a228f5f0058ee183f29f9eae0805c6e59d61c3b006760668d8d18ff0d12179"},
+ "jason": {:hex, :jason, "1.3.0", "fa6b82a934feb176263ad2df0dbd91bf633d4a46ebfdffea0c8ae82953714946", [:mix], [{:decimal, "~> 1.0 or ~> 2.0", [hex: :decimal, repo: "hexpm", optional: true]}], "hexpm", "53fc1f51255390e0ec7e50f9cb41e751c260d065dcba2bf0d08dc51a4002c2ac"},
"jiffy": {:hex, :jiffy, "0.15.2", "de266c390111fd4ea28b9302f0bc3d7472468f3b8e0aceabfbefa26d08cd73b7", [:rebar3], [], "hexpm"},
"junit_formatter": {:hex, :junit_formatter, "3.0.0", "13950d944dbd295da7d8cc4798b8faee808a8bb9b637c88069954eac078ac9da", [:mix], [], "hexpm", "d77b7b9a1601185b18dfe7682b27c46d5d12721f12fdc75180a6fc573b4e64b1"},
"metrics": {:hex, :metrics, "1.0.1", "25f094dea2cda98213cecc3aeff09e940299d950904393b2a29d191c346a8486", [:rebar3], [], "hexpm", "69b09adddc4f74a40716ae54d140f93beb0fb8978d8636eaded0c31b6f099f16"},