Skip to content

Commit 96202dd

Browse files
authored
Merge pull request #5247 from volodya-lombrozo/5224-enable-compound-lint
fix(#5224): rename `positive-infinity`/`negative-infinity` to `pinf`/`ninf` and `line-separator` to `eol`
2 parents 1738514 + 8ce87f4 commit 96202dd

21 files changed

Lines changed: 289 additions & 285 deletions

File tree

eo-runtime/pom.xml

Lines changed: 0 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -238,20 +238,6 @@
238238
names in the atoms, in order to enable this lint.
239239
-->
240240
<lint>duplicate-names-in-diff-context</lint>
241-
<!--
242-
@todo #4096:30min. Enable `sparse-decoration` lint.
243-
After we merged EO tests together with their source objects, and removed
244-
`+tests` meta, we have complains about sparse-decoration. Let's adjust and
245-
enable it.
246-
-->
247-
<!-- <lint>sparse-decoration</lint> -->
248-
<!--
249-
@todo #5221:30min Enable `compound-name` lint.
250-
Several objects in eo-runtime use compound names that follow system
251-
or platform naming conventions (e.g. neg-inf, groups-count, sin-family).
252-
Either rename the objects or adjust the lint rule, then enable it.
253-
-->
254-
<lint>compound-name</lint>
255241
</skipSourceLints>
256242
<skipProgramLints>
257243
<lint>inconsistent-args</lint>

eo-runtime/src/main/eo/bytes.eo

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -30,11 +30,11 @@
3030
eq nan.as-bytes
3131
nan
3232
if.
33-
eq positive-infinity.as-bytes
34-
positive-infinity
33+
eq pinf.as-bytes
34+
pinf
3535
if.
36-
eq negative-infinity.as-bytes
37-
negative-infinity
36+
eq ninf.as-bytes
37+
ninf
3838
if.
3939
size.eq 8
4040
number as-bytes

eo-runtime/src/main/eo/fs/file.eo

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
1-
+alias fs.file
2-
+alias fs.path
3-
+alias fs.tmpdir
41
+alias tt.contains
2+
+alias fs.file
53
+alias tt.joined
4+
+alias fs.path
65
+alias tt.sprintf
6+
+alias fs.tmpdir
77
+architect yegor256@gmail.com
88
+home https://github.com/objectionary/eo
99
+package fs

eo-runtime/src/main/eo/io/stdin.eo

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
+alias io.console
2-
+alias sm.line-separator
2+
+alias sm.eol
33
+architect yegor256@gmail.com
44
+home https://github.com/objectionary/eo
55
+package io
@@ -29,7 +29,7 @@
2929
# If there's no line to consume, it returns an empty string.
3030
[] > all-lines
3131
rec-read next-line -- true > @
32-
line-separator > separator!
32+
eol > separator!
3333

3434
# Recursive reading from console by one line.
3535
#

eo-runtime/src/main/eo/ms/acos.eo

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -67,12 +67,12 @@
6767
is-nan. > @
6868
acos nan
6969

70-
# Tests that arccosine of positive-infinity is NaN.
70+
# Tests that arccosine of pinf is NaN.
7171
[] +> tests-arccos-positive-infinity
7272
is-nan. > @
73-
acos positive-infinity
73+
acos pinf
7474

75-
# Tests that arccosine of negative-infinity is NaN.
75+
# Tests that arccosine of ninf is NaN.
7676
[] +> tests-arccos-negative-infinity
7777
is-nan. > @
78-
acos negative-infinity
78+
acos ninf

eo-runtime/src/main/eo/ms/asin.eo

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -71,9 +71,9 @@
7171
# Tests that asin of +inf equals NaN.
7272
[] +> tests-asin-positive-infinity
7373
is-nan. > @
74-
asin positive-infinity
74+
asin pinf
7575

7676
# Tests that asin of -inf equals NaN.
7777
[] +> tests-asin-negative-infinity
7878
is-nan. > @
79-
asin negative-infinity
79+
asin ninf

eo-runtime/src/main/eo/ms/exp.eo

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -61,11 +61,11 @@
6161
# Tests mathematical operation functionality.
6262
[] +> tests-exp-check-infinity-n1
6363
eq. > @
64-
exp positive-infinity
65-
positive-infinity
64+
exp pinf
65+
pinf
6666

6767
# Tests mathematical operation functionality.
6868
[] +> tests-exp-check-infinity-n2
6969
eq. > @
70-
exp negative-infinity
70+
exp ninf
7171
0

eo-runtime/src/main/eo/ms/ln.eo

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@
2020
[] +> tests-ln-of-zero-is-negative-infinity
2121
eq. > @
2222
ln 0
23-
negative-infinity
23+
ninf
2424

2525
# Tests that natural logarithm of 1 equals zero.
2626
[] +> tests-ln-of-one-is-zero
@@ -57,13 +57,13 @@
5757
# Tests that natural logarithm of positive infinity equals positive infinity.
5858
[] +> tests-ln-positive-infinity
5959
eq. > @
60-
ln positive-infinity
61-
positive-infinity
60+
ln pinf
61+
pinf
6262

6363
# Tests that natural logarithm of negative infinity returns NaN.
6464
[] +> tests-ln-negative-infinity
6565
is-nan. > @
66-
ln negative-infinity
66+
ln ninf
6767

6868
# Tests that natural logarithm of NaN returns NaN.
6969
[] +> tests-ln-nan

eo-runtime/src/main/eo/ms/numbers.eo

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@
1919
error "Can't get the max number from an empty sequence"
2020
reduced
2121
lst
22-
negative-infinity
22+
ninf
2323
[max item]
2424
if. > @
2525
item.as-number.gt max
@@ -34,7 +34,7 @@
3434
error "Can't get the min number from an empty sequence"
3535
reduced
3636
lst
37-
positive-infinity
37+
pinf
3838
[min item]
3939
if. > @
4040
min.gt item.as-number

eo-runtime/src/main/eo/ms/pow.eo

Lines changed: 32 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -77,60 +77,60 @@
7777
[] +> tests-zero-to-the-negative-pow-is-positive-infinity
7878
eq. > @
7979
pow 0 -52
80-
positive-infinity
80+
pinf
8181

8282
# Tests that zero raised to negative infinity equals positive infinity.
8383
[] +> tests-zero-to-the-negative-infinity-pow-is-positive-infinity
8484
eq. > @
85-
pow 0 negative-infinity
86-
positive-infinity
85+
pow 0 ninf
86+
pinf
8787

8888
# Tests that positive integer raised to negative infinity equals zero.
8989
[] +> tests-positive-int-to-the-pow-of-negative-infinity-is-zero
9090
eq. > @
91-
pow 42 negative-infinity
91+
pow 42 ninf
9292
0
9393

9494
# Tests that positive float raised to negative infinity equals zero.
9595
[] +> tests-positive-float-to-the-pow-of-negative-infinity-is-zero
9696
eq. > @
97-
pow 42.5 negative-infinity
97+
pow 42.5 ninf
9898
0
9999

100100
# Tests that negative integer raised to negative infinity equals zero.
101101
[] +> tests-negative-int-to-the-pow-of-negative-infinity-is-zero
102102
eq. > @
103-
pow -42 negative-infinity
103+
pow -42 ninf
104104
0
105105

106106
# Tests that negative float raised to negative infinity equals zero.
107107
[] +> tests-negative-float-to-the-pow-of-negative-infinity-is-zero
108108
eq. > @
109-
pow -42.5 negative-infinity
109+
pow -42.5 ninf
110110
0
111111

112112
# Tests that positive infinity raised to negative infinity equals zero.
113113
[] +> tests-positive-infinity-to-the-pow-of-negative-infinity-is-zero
114114
eq. > @
115-
pow positive-infinity negative-infinity
115+
pow pinf ninf
116116
0
117117

118118
# Tests that negative infinity raised to negative infinity equals zero.
119119
[] +> tests-negative-infinity-to-the-pow-of-negative-infinity-is-zero
120120
eq. > @
121-
pow negative-infinity negative-infinity
121+
pow ninf ninf
122122
0
123123

124124
# Tests that positive infinity raised to finite negative power equals zero.
125125
[] +> tests-positive-infinity-to-the-finite-negative-int-pow-is-zero
126126
eq. > @
127-
pow positive-infinity -42
127+
pow pinf -42
128128
0
129129

130130
# Tests that positive infinity raised to finite negative float power equals zero.
131131
[] +> tests-positive-infinity-to-the-finite-negative-float-pow-is-zero
132132
eq. > @
133-
pow positive-infinity -42.2
133+
pow pinf -42.2
134134
0.0
135135

136136
# Tests that 2 raised to the power of -1 equals 0.5.
@@ -173,68 +173,68 @@
173173
# Tests mathematical operation functionality.
174174
[] +> tests-zero-to-the-pow-of-positive-infinity-is-zero
175175
eq. > @
176-
pow 0 positive-infinity
176+
pow 0 pinf
177177
0
178178

179179
# Tests mathematical operation functionality.
180180
[] +> tests-negative-int-to-the-pow-of-positive-infinity-is-positive-infinity
181181
eq. > @
182-
pow -10 positive-infinity
183-
positive-infinity
182+
pow -10 pinf
183+
pinf
184184

185185
# Tests mathematical operation functionality.
186186
[] +> tests-negative-float-to-the-pow-of-positive-infinity-is-infinity
187187
eq. > @
188-
pow -4.2 positive-infinity
189-
positive-infinity
188+
pow -4.2 pinf
189+
pinf
190190

191191
# Tests mathematical operation functionality.
192192
[] +> tests-positive-int-to-the-pow-of-positive-infinity-is-positive-infinity
193193
eq. > @
194-
pow 42 positive-infinity
195-
positive-infinity
194+
pow 42 pinf
195+
pinf
196196

197197
# Tests mathematical operation functionality.
198198
[] +> tests-positive-float-to-the-pow-of-positive-infinity-is-positive-infinity
199199
eq. > @
200-
pow 42.5 positive-infinity
201-
positive-infinity
200+
pow 42.5 pinf
201+
pinf
202202

203203
# Tests mathematical operation functionality.
204204
[] +> tests-positive-infinity-to-the-pow-of-positive-int-is-positive-infinity
205205
eq. > @
206-
pow positive-infinity 42
207-
positive-infinity
206+
pow pinf 42
207+
pinf
208208

209209
# Tests mathematical operation functionality.
210210
[] +> tests-positive-infinity-to-the-pow-of-positive-float-is-positive-infinity
211211
eq. > @
212-
pow positive-infinity 10.8
213-
positive-infinity
212+
pow pinf 10.8
213+
pinf
214214

215215
# Tests mathematical operation functionality.
216216
[] +> tests-positive-infinity-to-the-pow-of-positive-infinity-is-positive-infinity
217217
eq. > @
218-
pow positive-infinity positive-infinity
219-
positive-infinity
218+
pow pinf pinf
219+
pinf
220220

221221
# Tests mathematical operation functionality.
222222
[] +> tests-negative-infinity-to-the-pow-of-positive-float-is-positive-infinity
223223
eq. > @
224-
pow negative-infinity 9.9
225-
positive-infinity
224+
pow ninf 9.9
225+
pinf
226226

227227
# Tests mathematical operation functionality.
228228
[] +> tests-negative-infinity-to-the-pow-of-even-positive-int-is-positive-infinity
229229
eq. > @
230-
pow negative-infinity 10
231-
positive-infinity
230+
pow ninf 10
231+
pinf
232232

233233
# Tests mathematical operation functionality.
234234
[] +> tests-negative-infinity-to-the-pow-of-odd-positive-int-is-positive-infinity
235235
eq. > @
236-
pow negative-infinity 9
237-
negative-infinity
236+
pow ninf 9
237+
ninf
238238

239239
# Tests mathematical operation functionality.
240240
[] +> tests-positive-int-to-the-pow-of-positive-int-is-int

0 commit comments

Comments
 (0)