Should we enable the unformatted-code-detection add-on?

In Can I get the permission to edit other peoples posts?, there was some discussion of a Discourse addon:

…that detects posts with code or log entries which are not formatted properly, and gives guidance an what to do. This can be enabled by default but made to turn off at certain trust levels (and there is a “don’t show this again” per-user setting).

I’ve enabled this currently on the “Testing (use at your own risk!)” site theme. It appears to have configuration for trust level, but not category. If anyone would like to improve the upstream so it also can be configured by category, that would be cool.

What does everyone think about turning this on by default?

  • Don’t enable
  • Enable for Trust Level 0 Only
  • Enable for Trust Level 0 and 1
  • Don’t enable unless it can be limited by category (to e.g. Ask Fedora)
0 voters

Can we test it first?

Most of what is posted here that needs formatting is terminal output, not code. If it only detects code, I think it will be more hassle than it will add value.

The algorithm looks for regex matches and calculates a code-energy level.
The regex are in this file

So it may not be great for logs or terminal output.

Yes. If you change your site theme setting at Fedora Discussion - Fedora Project community discussion happens here! to “Testing (use at your own risk!)”, this should be enabled, and I just changed the setting so that it is enabled regardless of trust level.

I guess… use this topic to test.

Device-1: AMD Navi 22 [Radeon RX 6700/6700 XT/6750 XT / 6800M/6850M XT]
driver: amdgpu v: kernel
Display: x11 server: X.Org v: 21.1.8 driver: X: loaded: amdgpu
unloaded: modesetting dri: radeonsi gpu: amdgpu resolution: 1: 2560x1440
2: N/A 3: 2560x1440
API: EGL v: 1.5 drivers: kms_swrast,radeonsi,swrast
platforms: gbm,x11,surfaceless,device
API: OpenGL v: 4.6 compat-v: 4.5 vendor: amd
renderer: AMD Radeon RX 6700 XT (navi22 LLVM 16.0.6 DRM 3.49)
API: Vulkan v: 1.3.264 drivers: radv surfaces: xcb,xlib

It seems to flag journalctl output but not much else that I tested.

I might be fine with it, if it would be opt-in, or at least op-out (e.g. in settings).
I can see the value for people who can’t format well, but I’m afraid it would annoy me personally highly, so I’d prefer it to be turned off for myself.

You have nothing to worry about as a TL2 user.

Not at this moment at this place.
But …

I have multiple experience that makes me absolutely furious. The usual story is:

I do a package maintenance work. Something urgent comes in. And it’s necessary to step in myself and contact the developers of the software. The upstream use some platform like this. Every upstream have a different one.
I have to register to the platform. Read through the guidelines. Find out how and where to post the urgent topic.
Then I’m writing a long, highly detailed post that precisely describes the problem, how it came to be, what are our options, and offering multiple solutions to discuss. All that with links to the documentation, Fedora Pagure, KOJI, BODHI, specific commits, Bugzilla(s), relevant pieces of logs, and any other web available resources.
And after I spend hour making this precise description, the forum / communication tool slaps me with any of those:

  • You are new user, you have to wait a day before posting
  • You can’t have an URL in a post
  • You can’t have more than X URLs in a post
    • when I post, then edit to add more URLs → “You are banned”
      • … and have fun contacting the admins when you’re banned
  • Your message can’t have more than X characters
  • Your message contains forbidden symbols
  • Your post waits for moderator approval (which takes days)
  • You can’t post to the selected group
  • This tag(s) can’t be used on posts for this group

or my favourite:

  • Post gets deleted when you switch windows (really happened)
    • or at least gets closed and moved to draft folder you don’t know exists, nor where. So it seems like it got deleted (also happened)
  • Post gets denied because someone else posted to the thread in the meanwhile (looking at you BZ !)

In the meanwhile, hundreds of packages in Fedora are on fire without a prospect of getting better. (true story)

Could you imagine, that on top of all that, the software would take the post and re-formatted it to what *it* thinks is I wanted ?

I know there has to be some spam protection. And I don’t know how to bring a balance. I know that might be the most uncommon use case.
I just want to give an alternative POV, with which I, sadly, meet more often than I’d like.

That’s why I’m willing to take such features only as optional.

I will increase the sensitivity of the plugin from 0.5 to 0.75… let’s see what that does!

The proposed change helps newbies learn the proper formatting, improves the readability of their posts, saves everyone’s time, and brings solution for their problems closer, provided a limited scope of affected users and the cost small enough to consider it negligible.

That isn’t what it does at all.

If it detects something it pops a message recommending that you reformat it and it tells you how to do it. The message that pops up has a checkbox you can check to never see the message again.

1 Like

Okay, then LGTM :bluethumb:

Does it really?
Or is the actual result that users become more and more dependent upon the tool and less and less inclined to think and do things for themselves.

If the tool is accurate enough to meet more than 90% of the need and to teach the user without performing the task for them then it may be useful. If not then taking the learning part out of the process leads to more problems in the long run as it leads to the expectation that “the system will fix errors for me” and we already see an enormous amount of posts with no sentence or paragraph structure that (at least some) are unreadable and merely noise.

Pasting screen text as preformatted text seems the most demanding of the tasks and some users are hard to train at times.