libcloud-notifications mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From to...@apache.org
Subject [01/11] libcloud git commit: Add a tox check which verifies we don't have any file which name is longer than 143 characters.
Date Tue, 19 Sep 2017 20:30:54 GMT
Repository: libcloud
Updated Branches:
  refs/heads/trunk a594266de -> cbae34ad0


Add a tox check which verifies we don't have any file which name is
longer than 143 characters.

143 characters seems to be the limit for ecryptfs file system layered on
top of ext4.

Source: https://askubuntu.com/questions/361976/find-files-with-a-minimum-filename-length

Part of LIBCLOUD-946.


Project: http://git-wip-us.apache.org/repos/asf/libcloud/repo
Commit: http://git-wip-us.apache.org/repos/asf/libcloud/commit/60701af4
Tree: http://git-wip-us.apache.org/repos/asf/libcloud/tree/60701af4
Diff: http://git-wip-us.apache.org/repos/asf/libcloud/diff/60701af4

Branch: refs/heads/trunk
Commit: 60701af4e610b9eeb4e3c60034300148933d69ba
Parents: 59b44a0
Author: Tomaz Muraus <tomaz@tomaz.me>
Authored: Tue Sep 19 18:00:09 2017 +0200
Committer: Tomaz Muraus <tomaz@tomaz.me>
Committed: Tue Sep 19 18:14:41 2017 +0200

----------------------------------------------------------------------
 contrib/check_file_names.sh | 34 ++++++++++++++++++++++++++++++++++
 tox.ini                     |  5 ++++-
 2 files changed, 38 insertions(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/libcloud/blob/60701af4/contrib/check_file_names.sh
----------------------------------------------------------------------
diff --git a/contrib/check_file_names.sh b/contrib/check_file_names.sh
new file mode 100755
index 0000000..6474347
--- /dev/null
+++ b/contrib/check_file_names.sh
@@ -0,0 +1,34 @@
+#!/usr/bin/env bash
+#  Licensed to the Apache Software Foundation (ASF) under one
+#  or more contributor license agreements.  See the NOTICE file
+#  distributed with this work for additional information
+#  regarding copyright ownership.  The ASF licenses this file
+#  to you 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.
+#
+# Script which checks there are no files which name is longer
+# than the allowed limit
+# ext4 support file name up to 255 characters long, but layering
+# ecrypt on top of it drops the limit to 143 characters
+
+FILE_NAME_LENGTH_LIMIT=143
+
+FILES=$(find libcloud/ -regextype posix-basic -regex ".*/.\{${FILE_NAME_LENGTH_LIMIT},\}")
+
+if [ "${FILES}" ]; then
+    echo "Found files which name is longer than ${FILE_NAME_LENGTH_LIMIT} characters"
+    echo "${FILES}"
+    exit 1
+fi
+
+exit 0

http://git-wip-us.apache.org/repos/asf/libcloud/blob/60701af4/tox.ini
----------------------------------------------------------------------
diff --git a/tox.ini b/tox.ini
index f33912e..1f6983b 100644
--- a/tox.ini
+++ b/tox.ini
@@ -12,7 +12,7 @@ commands = cp libcloud/test/secrets.py-dist libcloud/test/secrets.py
            python setup.py test
 basepython =
     py2.6: python2.6
-    {py2.7,lint,pylint,coverage}: python2.7
+    {py2.7,checks,lint,pylint,coverage}: python2.7
     docs: python3.5
     pypypy: pypy
     pypypy3: pypy3
@@ -85,6 +85,9 @@ commands = flake8 --ignore=E402 --exclude="test" libcloud/
            flake8 --ignore=E402,E902 --max-line-length=160 contrib/
            python -mjson.tool libcloud/data/pricing.json
 
+[testenv:checks]
+commands = ./contrib/check_file_names.sh
+
 [testenv:integration]
 deps = -r{toxinidir}/integration/requirements.txt
 


Mime
View raw message