Skip to content

Commit 5b7fc54

Browse files
committed
Passing pre-commit and adding licence to readme
1 parent 7b85218 commit 5b7fc54

File tree

7 files changed

+83
-10
lines changed

7 files changed

+83
-10
lines changed

.pre-commit-config.yaml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@ repos:
2020
hooks:
2121
- id: check-yaml
2222
- id: end-of-file-fixer
23+
exclude: "^rust/geo-test-fixtures/fixtures/.*"
2324
- id: trailing-whitespace
2425

2526
- repo: https://github.com/codespell-project/codespell

rust/geo-generic-alg/README.md

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,20 @@
1+
<!-- Licensed to the Apache Software Foundation (ASF) under one
2+
or more contributor license agreements. See the NOTICE file
3+
distributed with this work for additional information
4+
regarding copyright ownership. The ASF licenses this file
5+
to you under the Apache License, Version 2.0 (the
6+
"License"); you may not use this file except in compliance
7+
with the License. You may obtain a copy of the License at
8+
9+
http://www.apache.org/licenses/LICENSE-2.0
10+
11+
Unless required by applicable law or agreed to in writing,
12+
software distributed under the License is distributed on an
13+
"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
14+
KIND, either express or implied. See the License for the
15+
specific language governing permissions and limitations
16+
under the License. -->
17+
118
# Generic Algorithms for Geo-Traits
219

320
This crate contains algorithms ported from the [`geo` crate](https://github.com/georust/geo),

rust/geo-generic-alg/src/algorithm/line_measures/distance.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
pub trait Distance<F, Origin, Destination> {
33
/// Note that not all implementations support all geometry combinations, but at least `Point` to `Point`
44
/// is supported.
5-
/// See [specific implementations](#implementors) for details.
5+
/// See [specific implementations](#implementers) for details.
66
///
77
/// # Units
88
///

rust/geo-generic-alg/src/algorithm/simplify.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -130,7 +130,7 @@ where
130130
}
131131

132132
// The farthest index was less than or equal to epsilon, so we will retain only the first
133-
// and last indices, resulting in the indices inbetween getting culled.
133+
// and last indices, resulting in the indices in between getting culled.
134134

135135
// Update `simplified_len` to reflect the new number of indices by subtracting the number
136136
// of indices we're culling.

rust/geo-test-fixtures/README.md

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,19 @@
1+
<!-- Licensed to the Apache Software Foundation (ASF) under one
2+
or more contributor license agreements. See the NOTICE file
3+
distributed with this work for additional information
4+
regarding copyright ownership. The ASF licenses this file
5+
to you under the Apache License, Version 2.0 (the
6+
"License"); you may not use this file except in compliance
7+
with the License. You may obtain a copy of the License at
8+
9+
http://www.apache.org/licenses/LICENSE-2.0
10+
11+
Unless required by applicable law or agreed to in writing,
12+
software distributed under the License is distributed on an
13+
"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
14+
KIND, either express or implied. See the License for the
15+
specific language governing permissions and limitations
16+
under the License. -->
17+
118
This module was taken from the `geo` crate for testing the correctness of generic algorithms in `geo-generic-alg` crate.
219
Please refer to https://github.com/georust/geo/tree/geo-0.31.0/geo-test-fixtures for the original source code.
Lines changed: 29 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,31 @@
11
#!/usr/bin/env python3
2-
''' Script to parse coordinates through debug log, and replace them with easier
2+
3+
# Licensed to the Apache Software Foundation (ASF) under one
4+
# or more contributor license agreements. See the NOTICE file
5+
# distributed with this work for additional information
6+
# regarding copyright ownership. The ASF licenses this file
7+
# to you under the Apache License, Version 2.0 (the
8+
# "License"); you may not use this file except in compliance
9+
# with the License. You may obtain a copy of the License at
10+
#
11+
# http://www.apache.org/licenses/LICENSE-2.0
12+
#
13+
# Unless required by applicable law or agreed to in writing,
14+
# software distributed under the License is distributed on an
15+
# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
16+
# KIND, either express or implied. See the License for the
17+
# specific language governing permissions and limitations
18+
# under the License.
19+
20+
"""Script to parse coordinates through debug log, and replace them with easier
321
names.
422
5-
'''
23+
"""
624

725
import sys
826
import re
927

28+
1029
def main():
1130
pts = {}
1231

@@ -16,29 +35,31 @@ def main():
1635

1736
line = sys.stdin.readline()
1837
while line:
19-
if line.startswith('input:'):
20-
print(line, end='')
38+
if line.startswith("input:"):
39+
print(line, end="")
2140
m = regex.search(line)
2241
while m:
2342
st = m.start()
24-
print(line[:st], end='')
43+
print(line[:st], end="")
2544
sig = m.expand(r"\1#\2")
2645
if sig not in pts:
2746
pts[sig] = len(pts)
2847
idx = pts[sig]
29-
print(f'{idx}', end='')
48+
print(f"{idx}", end="")
3049

3150
en = m.end()
3251
line = line[en:]
3352
m = regex.search(line)
34-
print(line, end='')
53+
print(line, end="")
3554
line = sys.stdin.readline()
3655

3756
print("end of input")
3857
print("points:")
3958
for sig in pts:
40-
x,y = sig.split('#')
59+
x, y = sig.split("#")
4160
idx = pts[sig]
4261
print(f"\t{idx}: Pt({x} {y})")
62+
63+
4364
if __name__ == "__main__":
4465
main()

rust/geo-traits-ext/README.md

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,20 @@
1+
<!-- Licensed to the Apache Software Foundation (ASF) under one
2+
or more contributor license agreements. See the NOTICE file
3+
distributed with this work for additional information
4+
regarding copyright ownership. The ASF licenses this file
5+
to you under the Apache License, Version 2.0 (the
6+
"License"); you may not use this file except in compliance
7+
with the License. You may obtain a copy of the License at
8+
9+
http://www.apache.org/licenses/LICENSE-2.0
10+
11+
Unless required by applicable law or agreed to in writing,
12+
software distributed under the License is distributed on an
13+
"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
14+
KIND, either express or implied. See the License for the
15+
specific language governing permissions and limitations
16+
under the License. -->
17+
118
# Geo-Traits Extended
219

320
This crate extends the `geo-traits` crate with additional traits and

0 commit comments

Comments
 (0)