merge develop
[akkoma] / test / web / twitter_api / twitter_api_test.exs
1 # Pleroma: A lightweight social networking server
2 # Copyright © 2017-2018 Pleroma Authors <https://pleroma.social/>
3 # SPDX-License-Identifier: AGPL-3.0-only
4
5 defmodule Pleroma.Web.TwitterAPI.TwitterAPITest do
6 use Pleroma.DataCase
7 alias Pleroma.Activity
8 alias Pleroma.Object
9 alias Pleroma.Repo
10 alias Pleroma.User
11 alias Pleroma.UserInviteToken
12 alias Pleroma.Web.ActivityPub.ActivityPub
13 alias Pleroma.Web.TwitterAPI.ActivityView
14 alias Pleroma.Web.TwitterAPI.TwitterAPI
15 alias Pleroma.Web.TwitterAPI.UserView
16
17 import Pleroma.Factory
18
19 setup_all do
20 Tesla.Mock.mock_global(fn env -> apply(HttpRequestMock, :request, [env]) end)
21 :ok
22 end
23
24 test "create a status" do
25 user = insert(:user)
26 mentioned_user = insert(:user, %{nickname: "shp", ap_id: "shp"})
27
28 object_data = %{
29 "type" => "Image",
30 "url" => [
31 %{
32 "type" => "Link",
33 "mediaType" => "image/jpg",
34 "href" => "http://example.org/image.jpg"
35 }
36 ],
37 "uuid" => 1
38 }
39
40 object = Repo.insert!(%Object{data: object_data})
41
42 input = %{
43 "status" =>
44 "Hello again, @shp.<script></script>\nThis is on another :firefox: line. #2hu #epic #phantasmagoric",
45 "media_ids" => [object.id]
46 }
47
48 {:ok, activity = %Activity{}} = TwitterAPI.create_status(user, input)
49 object = Object.normalize(activity)
50
51 expected_text =
52 "Hello again, <span class='h-card'><a data-user='#{mentioned_user.id}' class='u-url mention' href='shp'>@<span>shp</span></a></span>.&lt;script&gt;&lt;/script&gt;<br>This is on another :firefox: line. <a class='hashtag' data-tag='2hu' href='http://localhost:4001/tag/2hu' rel='tag'>#2hu</a> <a class='hashtag' data-tag='epic' href='http://localhost:4001/tag/epic' rel='tag'>#epic</a> <a class='hashtag' data-tag='phantasmagoric' href='http://localhost:4001/tag/phantasmagoric' rel='tag'>#phantasmagoric</a><br><a href=\"http://example.org/image.jpg\" class='attachment'>image.jpg</a>"
53
54 assert get_in(object.data, ["content"]) == expected_text
55 assert get_in(object.data, ["type"]) == "Note"
56 assert get_in(object.data, ["actor"]) == user.ap_id
57 assert get_in(activity.data, ["actor"]) == user.ap_id
58 assert Enum.member?(get_in(activity.data, ["cc"]), User.ap_followers(user))
59
60 assert Enum.member?(
61 get_in(activity.data, ["to"]),
62 "https://www.w3.org/ns/activitystreams#Public"
63 )
64
65 assert Enum.member?(get_in(activity.data, ["to"]), "shp")
66 assert activity.local == true
67
68 assert %{"firefox" => "http://localhost:4001/emoji/Firefox.gif"} = object.data["emoji"]
69
70 # hashtags
71 assert object.data["tag"] == ["2hu", "epic", "phantasmagoric"]
72
73 # Add a context
74 assert is_binary(get_in(activity.data, ["context"]))
75 assert is_binary(get_in(object.data, ["context"]))
76
77 assert is_list(object.data["attachment"])
78
79 assert activity.data["object"] == object.data["id"]
80
81 user = User.get_cached_by_ap_id(user.ap_id)
82
83 assert user.info.note_count == 1
84 end
85
86 test "create a status that is a reply" do
87 user = insert(:user)
88
89 input = %{
90 "status" => "Hello again."
91 }
92
93 {:ok, activity = %Activity{}} = TwitterAPI.create_status(user, input)
94 object = Object.normalize(activity)
95
96 input = %{
97 "status" => "Here's your (you).",
98 "in_reply_to_status_id" => activity.id
99 }
100
101 {:ok, reply = %Activity{}} = TwitterAPI.create_status(user, input)
102 reply_object = Object.normalize(reply)
103
104 assert get_in(reply.data, ["context"]) == get_in(activity.data, ["context"])
105
106 assert get_in(reply_object.data, ["context"]) == get_in(object.data, ["context"])
107
108 assert get_in(reply_object.data, ["inReplyTo"]) == get_in(activity.data, ["object"])
109 assert Activity.get_in_reply_to_activity(reply).id == activity.id
110 end
111
112 test "Follow another user using user_id" do
113 user = insert(:user)
114 followed = insert(:user)
115
116 {:ok, user, followed, _activity} = TwitterAPI.follow(user, %{"user_id" => followed.id})
117 assert User.ap_followers(followed) in user.following
118
119 {:ok, _, _, _} = TwitterAPI.follow(user, %{"user_id" => followed.id})
120 end
121
122 test "Follow another user using screen_name" do
123 user = insert(:user)
124 followed = insert(:user)
125
126 {:ok, user, followed, _activity} =
127 TwitterAPI.follow(user, %{"screen_name" => followed.nickname})
128
129 assert User.ap_followers(followed) in user.following
130
131 followed = User.get_cached_by_ap_id(followed.ap_id)
132 assert followed.info.follower_count == 1
133
134 {:ok, _, _, _} = TwitterAPI.follow(user, %{"screen_name" => followed.nickname})
135 end
136
137 test "Unfollow another user using user_id" do
138 unfollowed = insert(:user)
139 user = insert(:user, %{following: [User.ap_followers(unfollowed)]})
140 ActivityPub.follow(user, unfollowed)
141
142 {:ok, user, unfollowed} = TwitterAPI.unfollow(user, %{"user_id" => unfollowed.id})
143 assert user.following == []
144
145 {:error, msg} = TwitterAPI.unfollow(user, %{"user_id" => unfollowed.id})
146 assert msg == "Not subscribed!"
147 end
148
149 test "Unfollow another user using screen_name" do
150 unfollowed = insert(:user)
151 user = insert(:user, %{following: [User.ap_followers(unfollowed)]})
152
153 ActivityPub.follow(user, unfollowed)
154
155 {:ok, user, unfollowed} = TwitterAPI.unfollow(user, %{"screen_name" => unfollowed.nickname})
156 assert user.following == []
157
158 {:error, msg} = TwitterAPI.unfollow(user, %{"screen_name" => unfollowed.nickname})
159 assert msg == "Not subscribed!"
160 end
161
162 test "Block another user using user_id" do
163 user = insert(:user)
164 blocked = insert(:user)
165
166 {:ok, user, blocked} = TwitterAPI.block(user, %{"user_id" => blocked.id})
167 assert User.blocks?(user, blocked)
168 end
169
170 test "Block another user using screen_name" do
171 user = insert(:user)
172 blocked = insert(:user)
173
174 {:ok, user, blocked} = TwitterAPI.block(user, %{"screen_name" => blocked.nickname})
175 assert User.blocks?(user, blocked)
176 end
177
178 test "Unblock another user using user_id" do
179 unblocked = insert(:user)
180 user = insert(:user)
181 {:ok, user, _unblocked} = TwitterAPI.block(user, %{"user_id" => unblocked.id})
182
183 {:ok, user, _unblocked} = TwitterAPI.unblock(user, %{"user_id" => unblocked.id})
184 assert user.info.blocks == []
185 end
186
187 test "Unblock another user using screen_name" do
188 unblocked = insert(:user)
189 user = insert(:user)
190 {:ok, user, _unblocked} = TwitterAPI.block(user, %{"screen_name" => unblocked.nickname})
191
192 {:ok, user, _unblocked} = TwitterAPI.unblock(user, %{"screen_name" => unblocked.nickname})
193 assert user.info.blocks == []
194 end
195
196 test "upload a file" do
197 user = insert(:user)
198
199 file = %Plug.Upload{
200 content_type: "image/jpg",
201 path: Path.absname("test/fixtures/image.jpg"),
202 filename: "an_image.jpg"
203 }
204
205 response = TwitterAPI.upload(file, user)
206
207 assert is_binary(response)
208 end
209
210 test "it favorites a status, returns the updated activity" do
211 user = insert(:user)
212 other_user = insert(:user)
213 note_activity = insert(:note_activity)
214
215 {:ok, status} = TwitterAPI.fav(user, note_activity.id)
216 updated_activity = Activity.get_by_ap_id(note_activity.data["id"])
217 assert ActivityView.render("activity.json", %{activity: updated_activity})["fave_num"] == 1
218
219 object = Object.normalize(note_activity)
220
221 assert object.data["like_count"] == 1
222
223 assert status == updated_activity
224
225 {:ok, _status} = TwitterAPI.fav(other_user, note_activity.id)
226
227 object = Object.normalize(note_activity)
228
229 assert object.data["like_count"] == 2
230
231 updated_activity = Activity.get_by_ap_id(note_activity.data["id"])
232 assert ActivityView.render("activity.json", %{activity: updated_activity})["fave_num"] == 2
233 end
234
235 test "it unfavorites a status, returns the updated activity" do
236 user = insert(:user)
237 note_activity = insert(:note_activity)
238 object = Object.normalize(note_activity)
239
240 {:ok, _like_activity, _object} = ActivityPub.like(user, object)
241 updated_activity = Activity.get_by_ap_id(note_activity.data["id"])
242
243 assert ActivityView.render("activity.json", activity: updated_activity)["fave_num"] == 1
244
245 {:ok, activity} = TwitterAPI.unfav(user, note_activity.id)
246
247 assert ActivityView.render("activity.json", activity: activity)["fave_num"] == 0
248 end
249
250 test "it retweets a status and returns the retweet" do
251 user = insert(:user)
252 note_activity = insert(:note_activity)
253
254 {:ok, status} = TwitterAPI.repeat(user, note_activity.id)
255 updated_activity = Activity.get_by_ap_id(note_activity.data["id"])
256
257 assert status == updated_activity
258 end
259
260 test "it unretweets an already retweeted status" do
261 user = insert(:user)
262 note_activity = insert(:note_activity)
263
264 {:ok, _status} = TwitterAPI.repeat(user, note_activity.id)
265 {:ok, status} = TwitterAPI.unrepeat(user, note_activity.id)
266 updated_activity = Activity.get_by_ap_id(note_activity.data["id"])
267
268 assert status == updated_activity
269 end
270
271 test "it registers a new user and returns the user." do
272 data = %{
273 "nickname" => "lain",
274 "email" => "lain@wired.jp",
275 "fullname" => "lain iwakura",
276 "password" => "bear",
277 "confirm" => "bear"
278 }
279
280 {:ok, user} = TwitterAPI.register_user(data)
281
282 fetched_user = User.get_cached_by_nickname("lain")
283
284 assert UserView.render("show.json", %{user: user}) ==
285 UserView.render("show.json", %{user: fetched_user})
286 end
287
288 test "it registers a new user with empty string in bio and returns the user." do
289 data = %{
290 "nickname" => "lain",
291 "email" => "lain@wired.jp",
292 "fullname" => "lain iwakura",
293 "bio" => "",
294 "password" => "bear",
295 "confirm" => "bear"
296 }
297
298 {:ok, user} = TwitterAPI.register_user(data)
299
300 fetched_user = User.get_cached_by_nickname("lain")
301
302 assert UserView.render("show.json", %{user: user}) ==
303 UserView.render("show.json", %{user: fetched_user})
304 end
305
306 test "it sends confirmation email if :account_activation_required is specified in instance config" do
307 setting = Pleroma.Config.get([:instance, :account_activation_required])
308
309 unless setting do
310 Pleroma.Config.put([:instance, :account_activation_required], true)
311 on_exit(fn -> Pleroma.Config.put([:instance, :account_activation_required], setting) end)
312 end
313
314 data = %{
315 "nickname" => "lain",
316 "email" => "lain@wired.jp",
317 "fullname" => "lain iwakura",
318 "bio" => "",
319 "password" => "bear",
320 "confirm" => "bear"
321 }
322
323 {:ok, user} = TwitterAPI.register_user(data)
324
325 assert user.info.confirmation_pending
326
327 email = Pleroma.Emails.UserEmail.account_confirmation_email(user)
328
329 notify_email = Pleroma.Config.get([:instance, :notify_email])
330 instance_name = Pleroma.Config.get([:instance, :name])
331
332 Swoosh.TestAssertions.assert_email_sent(
333 from: {instance_name, notify_email},
334 to: {user.name, user.email},
335 html_body: email.html_body
336 )
337 end
338
339 test "it registers a new user and parses mentions in the bio" do
340 data1 = %{
341 "nickname" => "john",
342 "email" => "john@gmail.com",
343 "fullname" => "John Doe",
344 "bio" => "test",
345 "password" => "bear",
346 "confirm" => "bear"
347 }
348
349 {:ok, user1} = TwitterAPI.register_user(data1)
350
351 data2 = %{
352 "nickname" => "lain",
353 "email" => "lain@wired.jp",
354 "fullname" => "lain iwakura",
355 "bio" => "@john test",
356 "password" => "bear",
357 "confirm" => "bear"
358 }
359
360 {:ok, user2} = TwitterAPI.register_user(data2)
361
362 expected_text =
363 "<span class='h-card'><a data-user='#{user1.id}' class='u-url mention' href='#{user1.ap_id}'>@<span>john</span></a></span> test"
364
365 assert user2.bio == expected_text
366 end
367
368 describe "register with one time token" do
369 setup do
370 setting = Pleroma.Config.get([:instance, :registrations_open])
371
372 if setting do
373 Pleroma.Config.put([:instance, :registrations_open], false)
374 on_exit(fn -> Pleroma.Config.put([:instance, :registrations_open], setting) end)
375 end
376
377 :ok
378 end
379
380 test "returns user on success" do
381 {:ok, invite} = UserInviteToken.create_invite()
382
383 data = %{
384 "nickname" => "vinny",
385 "email" => "pasta@pizza.vs",
386 "fullname" => "Vinny Vinesauce",
387 "bio" => "streamer",
388 "password" => "hiptofbees",
389 "confirm" => "hiptofbees",
390 "token" => invite.token
391 }
392
393 {:ok, user} = TwitterAPI.register_user(data)
394
395 fetched_user = User.get_cached_by_nickname("vinny")
396 invite = Repo.get_by(UserInviteToken, token: invite.token)
397
398 assert invite.used == true
399
400 assert UserView.render("show.json", %{user: user}) ==
401 UserView.render("show.json", %{user: fetched_user})
402 end
403
404 test "returns error on invalid token" do
405 data = %{
406 "nickname" => "GrimReaper",
407 "email" => "death@reapers.afterlife",
408 "fullname" => "Reaper Grim",
409 "bio" => "Your time has come",
410 "password" => "scythe",
411 "confirm" => "scythe",
412 "token" => "DudeLetMeInImAFairy"
413 }
414
415 {:error, msg} = TwitterAPI.register_user(data)
416
417 assert msg == "Invalid token"
418 refute User.get_cached_by_nickname("GrimReaper")
419 end
420
421 test "returns error on expired token" do
422 {:ok, invite} = UserInviteToken.create_invite()
423 UserInviteToken.update_invite!(invite, used: true)
424
425 data = %{
426 "nickname" => "GrimReaper",
427 "email" => "death@reapers.afterlife",
428 "fullname" => "Reaper Grim",
429 "bio" => "Your time has come",
430 "password" => "scythe",
431 "confirm" => "scythe",
432 "token" => invite.token
433 }
434
435 {:error, msg} = TwitterAPI.register_user(data)
436
437 assert msg == "Expired token"
438 refute User.get_cached_by_nickname("GrimReaper")
439 end
440 end
441
442 describe "registers with date limited token" do
443 setup do
444 setting = Pleroma.Config.get([:instance, :registrations_open])
445
446 if setting do
447 Pleroma.Config.put([:instance, :registrations_open], false)
448 on_exit(fn -> Pleroma.Config.put([:instance, :registrations_open], setting) end)
449 end
450
451 data = %{
452 "nickname" => "vinny",
453 "email" => "pasta@pizza.vs",
454 "fullname" => "Vinny Vinesauce",
455 "bio" => "streamer",
456 "password" => "hiptofbees",
457 "confirm" => "hiptofbees"
458 }
459
460 check_fn = fn invite ->
461 data = Map.put(data, "token", invite.token)
462 {:ok, user} = TwitterAPI.register_user(data)
463 fetched_user = User.get_cached_by_nickname("vinny")
464
465 assert UserView.render("show.json", %{user: user}) ==
466 UserView.render("show.json", %{user: fetched_user})
467 end
468
469 {:ok, data: data, check_fn: check_fn}
470 end
471
472 test "returns user on success", %{check_fn: check_fn} do
473 {:ok, invite} = UserInviteToken.create_invite(%{expires_at: Date.utc_today()})
474
475 check_fn.(invite)
476
477 invite = Repo.get_by(UserInviteToken, token: invite.token)
478
479 refute invite.used
480 end
481
482 test "returns user on token which expired tomorrow", %{check_fn: check_fn} do
483 {:ok, invite} = UserInviteToken.create_invite(%{expires_at: Date.add(Date.utc_today(), 1)})
484
485 check_fn.(invite)
486
487 invite = Repo.get_by(UserInviteToken, token: invite.token)
488
489 refute invite.used
490 end
491
492 test "returns an error on overdue date", %{data: data} do
493 {:ok, invite} = UserInviteToken.create_invite(%{expires_at: Date.add(Date.utc_today(), -1)})
494
495 data = Map.put(data, "token", invite.token)
496
497 {:error, msg} = TwitterAPI.register_user(data)
498
499 assert msg == "Expired token"
500 refute User.get_cached_by_nickname("vinny")
501 invite = Repo.get_by(UserInviteToken, token: invite.token)
502
503 refute invite.used
504 end
505 end
506
507 describe "registers with reusable token" do
508 setup do
509 setting = Pleroma.Config.get([:instance, :registrations_open])
510
511 if setting do
512 Pleroma.Config.put([:instance, :registrations_open], false)
513 on_exit(fn -> Pleroma.Config.put([:instance, :registrations_open], setting) end)
514 end
515
516 :ok
517 end
518
519 test "returns user on success, after him registration fails" do
520 {:ok, invite} = UserInviteToken.create_invite(%{max_use: 100})
521
522 UserInviteToken.update_invite!(invite, uses: 99)
523
524 data = %{
525 "nickname" => "vinny",
526 "email" => "pasta@pizza.vs",
527 "fullname" => "Vinny Vinesauce",
528 "bio" => "streamer",
529 "password" => "hiptofbees",
530 "confirm" => "hiptofbees",
531 "token" => invite.token
532 }
533
534 {:ok, user} = TwitterAPI.register_user(data)
535 fetched_user = User.get_cached_by_nickname("vinny")
536 invite = Repo.get_by(UserInviteToken, token: invite.token)
537
538 assert invite.used == true
539
540 assert UserView.render("show.json", %{user: user}) ==
541 UserView.render("show.json", %{user: fetched_user})
542
543 data = %{
544 "nickname" => "GrimReaper",
545 "email" => "death@reapers.afterlife",
546 "fullname" => "Reaper Grim",
547 "bio" => "Your time has come",
548 "password" => "scythe",
549 "confirm" => "scythe",
550 "token" => invite.token
551 }
552
553 {:error, msg} = TwitterAPI.register_user(data)
554
555 assert msg == "Expired token"
556 refute User.get_cached_by_nickname("GrimReaper")
557 end
558 end
559
560 describe "registers with reusable date limited token" do
561 setup do
562 setting = Pleroma.Config.get([:instance, :registrations_open])
563
564 if setting do
565 Pleroma.Config.put([:instance, :registrations_open], false)
566 on_exit(fn -> Pleroma.Config.put([:instance, :registrations_open], setting) end)
567 end
568
569 :ok
570 end
571
572 test "returns user on success" do
573 {:ok, invite} = UserInviteToken.create_invite(%{expires_at: Date.utc_today(), max_use: 100})
574
575 data = %{
576 "nickname" => "vinny",
577 "email" => "pasta@pizza.vs",
578 "fullname" => "Vinny Vinesauce",
579 "bio" => "streamer",
580 "password" => "hiptofbees",
581 "confirm" => "hiptofbees",
582 "token" => invite.token
583 }
584
585 {:ok, user} = TwitterAPI.register_user(data)
586 fetched_user = User.get_cached_by_nickname("vinny")
587 invite = Repo.get_by(UserInviteToken, token: invite.token)
588
589 refute invite.used
590
591 assert UserView.render("show.json", %{user: user}) ==
592 UserView.render("show.json", %{user: fetched_user})
593 end
594
595 test "error after max uses" do
596 {:ok, invite} = UserInviteToken.create_invite(%{expires_at: Date.utc_today(), max_use: 100})
597
598 UserInviteToken.update_invite!(invite, uses: 99)
599
600 data = %{
601 "nickname" => "vinny",
602 "email" => "pasta@pizza.vs",
603 "fullname" => "Vinny Vinesauce",
604 "bio" => "streamer",
605 "password" => "hiptofbees",
606 "confirm" => "hiptofbees",
607 "token" => invite.token
608 }
609
610 {:ok, user} = TwitterAPI.register_user(data)
611 fetched_user = User.get_cached_by_nickname("vinny")
612 invite = Repo.get_by(UserInviteToken, token: invite.token)
613 assert invite.used == true
614
615 assert UserView.render("show.json", %{user: user}) ==
616 UserView.render("show.json", %{user: fetched_user})
617
618 data = %{
619 "nickname" => "GrimReaper",
620 "email" => "death@reapers.afterlife",
621 "fullname" => "Reaper Grim",
622 "bio" => "Your time has come",
623 "password" => "scythe",
624 "confirm" => "scythe",
625 "token" => invite.token
626 }
627
628 {:error, msg} = TwitterAPI.register_user(data)
629
630 assert msg == "Expired token"
631 refute User.get_cached_by_nickname("GrimReaper")
632 end
633
634 test "returns error on overdue date" do
635 {:ok, invite} =
636 UserInviteToken.create_invite(%{expires_at: Date.add(Date.utc_today(), -1), max_use: 100})
637
638 data = %{
639 "nickname" => "GrimReaper",
640 "email" => "death@reapers.afterlife",
641 "fullname" => "Reaper Grim",
642 "bio" => "Your time has come",
643 "password" => "scythe",
644 "confirm" => "scythe",
645 "token" => invite.token
646 }
647
648 {:error, msg} = TwitterAPI.register_user(data)
649
650 assert msg == "Expired token"
651 refute User.get_cached_by_nickname("GrimReaper")
652 end
653
654 test "returns error on with overdue date and after max" do
655 {:ok, invite} =
656 UserInviteToken.create_invite(%{expires_at: Date.add(Date.utc_today(), -1), max_use: 100})
657
658 UserInviteToken.update_invite!(invite, uses: 100)
659
660 data = %{
661 "nickname" => "GrimReaper",
662 "email" => "death@reapers.afterlife",
663 "fullname" => "Reaper Grim",
664 "bio" => "Your time has come",
665 "password" => "scythe",
666 "confirm" => "scythe",
667 "token" => invite.token
668 }
669
670 {:error, msg} = TwitterAPI.register_user(data)
671
672 assert msg == "Expired token"
673 refute User.get_cached_by_nickname("GrimReaper")
674 end
675 end
676
677 test "it returns the error on registration problems" do
678 data = %{
679 "nickname" => "lain",
680 "email" => "lain@wired.jp",
681 "fullname" => "lain iwakura",
682 "bio" => "close the world.",
683 "password" => "bear"
684 }
685
686 {:error, error_object} = TwitterAPI.register_user(data)
687
688 assert is_binary(error_object[:error])
689 refute User.get_cached_by_nickname("lain")
690 end
691
692 test "it assigns an integer conversation_id" do
693 note_activity = insert(:note_activity)
694 status = ActivityView.render("activity.json", activity: note_activity)
695
696 assert is_number(status["statusnet_conversation_id"])
697 end
698
699 setup do
700 Supervisor.terminate_child(Pleroma.Supervisor, Cachex)
701 Supervisor.restart_child(Pleroma.Supervisor, Cachex)
702 :ok
703 end
704
705 describe "fetching a user by uri" do
706 test "fetches a user by uri" do
707 id = "https://mastodon.social/users/lambadalambda"
708 user = insert(:user)
709 {:ok, represented} = TwitterAPI.get_external_profile(user, id)
710 remote = User.get_cached_by_ap_id(id)
711
712 assert represented["id"] == UserView.render("show.json", %{user: remote, for: user})["id"]
713
714 # Also fetches the feed.
715 # assert Activity.get_create_by_object_ap_id("tag:mastodon.social,2017-04-05:objectId=1641750:objectType=Status")
716 # credo:disable-for-previous-line Credo.Check.Readability.MaxLineLength
717 end
718 end
719 end