Selaa lähdekoodia

Replace CRLF by LF in color table, test, license (#2147)

* Replace CRLF by LF in nlcd color table file. (All other have LF.)
* Replace CRLF by LF and remove form feed (FF) char and FF 'materialized' as chars ^L from external ccmath library license file.
* Replace CRLF by LF and remove trailing whitespace from v.random test script (passes Flake8 now).

Several files which are expected to have LF (Line Feed aka unix line endings) contain CRLF (Carriage Return and Line Feed aka dos line endings/separators). This PR replaces CRLF by LF using dos2unix which includes adding LF to the end of the file if needed (CRLF is dos line separator while LF is unix line ending). Additionally, other whitespace related issues are resolved in the modified files.
Vaclav Petras 3 vuotta sitten
vanhempi
commit
b8ae3bb419
3 muutettua tiedostoa jossa 601 lisäystä ja 603 poistoa
  1. 511 513
      lib/external/ccmath/lgpl.license
  2. 22 22
      lib/gis/colors/nlcd
  3. 68 68
      vector/v.random/testsuite/test_v_random.py

Tiedoston diff-näkymää rajattu, sillä se on liian suuri
+ 511 - 513
lib/external/ccmath/lgpl.license


+ 22 - 22
lib/gis/colors/nlcd

@@ -1,22 +1,22 @@
-# color table for USGS National Land Cover Dataset
-0 255 255 255
-11 72:109:162
-12 231:239:252
-21 225:205:206
-22 220:152:129
-23 241:1:0
-24 171:1:1
-31 179:175:164
-41 108:169:102
-42 29:101:51
-43 189:204:147
-51 175:150:60
-52 209:187:130
-71 237:236:205
-72 208:209:129
-73 164:204:81
-74 130:186:157
-81 221:216:62
-82 174:114:41
-90 187:215:237
-95 113:164:193
+# color table for USGS National Land Cover Dataset
+0 255 255 255
+11 72:109:162
+12 231:239:252
+21 225:205:206
+22 220:152:129
+23 241:1:0
+24 171:1:1
+31 179:175:164
+41 108:169:102
+42 29:101:51
+43 189:204:147
+51 175:150:60
+52 209:187:130
+71 237:236:205
+72 208:209:129
+73 164:204:81
+74 130:186:157
+81 221:216:62
+82 174:114:41
+90 187:215:237
+95 113:164:193

+ 68 - 68
vector/v.random/testsuite/test_v_random.py

@@ -1,68 +1,68 @@
-#!/usr/bin/env python3
-""" 
-Name:      v.random test
-Purpose:   Tests v.random and its flags/options.
-Authors:   Josef Pudil (original draft)
-           Sunveer Singh (finished test)
-Copyright: (C) 2020-2021 by Sunveer Singh and the GRASS Development Team
-Licence:   This program is free software under the GNU General Public
-           License (>=v2). Read the file COPYING that comes with GRASS
-           for details.
-"""
-from grass.gunittest.case import TestCase
-from grass.gunittest.main import test
-
-
-class TestVRandom(TestCase):
-    output = "test01"
-    output2 = "test02"
-    npoints = 100
-    state = "nc_state"
-    zmin = 10
-    zmax = 120
-
-    @classmethod
-    def setUpClass(cls):
-        cls.use_temp_region()
-        cls.runModule("g.region", vector=cls.state)
-
-    @classmethod
-    def tearDownClass(cls):
-        cls.del_temp_region()
-
-    def tearDown(cls):
-        cls.runModule("g.remove", type="vector", flags="f", name=cls.output)
-        cls.runModule("g.remove", type="vector", flags="f", name=cls.output2)
-
-    def test_num_points(self):
-        """Checking if number of points equals 100"""
-        self.assertModule("v.random", output=self.output, npoints=self.npoints)
-        topology = dict(points=self.npoints)
-        self.assertVectorFitsTopoInfo(vector=self.output, reference=topology)
-
-    def test_num_points_3D(self):
-        """Checking if the map is 3D and number of points is 100"""
-        self.assertModule(
-            "v.random",
-            output=self.output,
-            npoints=self.npoints,
-            zmin=self.zmin,
-            zmax=self.zmax,
-            flags="z",
-        )
-        topology = dict(points=self.npoints, map3d=1)
-        self.assertVectorFitsTopoInfo(vector=self.output, reference=topology)
-
-    def test_restrict(self):
-        """Checking if all points are in the polygon boundary state"""
-        self.assertModule(
-            "v.random", output=self.output, npoints=self.npoints, restrict=self.state
-        )
-        self.assertModule(
-            "v.clip", input=self.output, clip=self.state, output=self.output2
-        )
-        self.assertVectorInfoEqualsVectorInfo(self.output, self.output2, precision=0.01)
-
-
-if __name__ == "__main__":
-    test()
+#!/usr/bin/env python3
+"""
+Name:      v.random test
+Purpose:   Tests v.random and its flags/options.
+Authors:   Josef Pudil (original draft)
+           Sunveer Singh (finished test)
+Copyright: (C) 2020-2021 by Sunveer Singh and the GRASS Development Team
+Licence:   This program is free software under the GNU General Public
+           License (>=v2). Read the file COPYING that comes with GRASS
+           for details.
+"""
+from grass.gunittest.case import TestCase
+from grass.gunittest.main import test
+
+
+class TestVRandom(TestCase):
+    output = "test01"
+    output2 = "test02"
+    npoints = 100
+    state = "nc_state"
+    zmin = 10
+    zmax = 120
+
+    @classmethod
+    def setUpClass(cls):
+        cls.use_temp_region()
+        cls.runModule("g.region", vector=cls.state)
+
+    @classmethod
+    def tearDownClass(cls):
+        cls.del_temp_region()
+
+    def tearDown(cls):
+        cls.runModule("g.remove", type="vector", flags="f", name=cls.output)
+        cls.runModule("g.remove", type="vector", flags="f", name=cls.output2)
+
+    def test_num_points(self):
+        """Checking if number of points equals 100"""
+        self.assertModule("v.random", output=self.output, npoints=self.npoints)
+        topology = dict(points=self.npoints)
+        self.assertVectorFitsTopoInfo(vector=self.output, reference=topology)
+
+    def test_num_points_3D(self):
+        """Checking if the map is 3D and number of points is 100"""
+        self.assertModule(
+            "v.random",
+            output=self.output,
+            npoints=self.npoints,
+            zmin=self.zmin,
+            zmax=self.zmax,
+            flags="z",
+        )
+        topology = dict(points=self.npoints, map3d=1)
+        self.assertVectorFitsTopoInfo(vector=self.output, reference=topology)
+
+    def test_restrict(self):
+        """Checking if all points are in the polygon boundary state"""
+        self.assertModule(
+            "v.random", output=self.output, npoints=self.npoints, restrict=self.state
+        )
+        self.assertModule(
+            "v.clip", input=self.output, clip=self.state, output=self.output2
+        )
+        self.assertVectorInfoEqualsVectorInfo(self.output, self.output2, precision=0.01)
+
+
+if __name__ == "__main__":
+    test()