objectionary / objectionary/lints

branch code sharing should be prohibited

Open
#378 7 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

enhancement
Dominant language
Java
Stars
14
Forks
39
Avg merge
22h 54m
Merged PRs (30d)
90

Description

Consider this EO program:

[x] > branches-share-code
  if. > @
    x.eq 1
    stdout "Boom!"
    1
    0
  if. > list-is-empty
    list.is-emtpy
    stdout "Boom!"
    2
    0

both if branches share stdout "Boom!". It can be re-written as such:

[x] > clean-branches
  stdout "Boom!"
  if. > @
    x.eq 1
    1
    0
  if. > list-is-empty
    list.is-emtpy
    2
    0

Let's create a lint that will complain about code sharing between if branches.

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by examining existing XMIR style checkers and their tests, then trace how if branches are represented and compared. Done means the lint reports expressions shared between branches, such as stdout "Boom!", while allowing the equivalent code moved before the branches.

Written by the indexing model from the issue text.

Assessment

Tech stack
java
Domain
tooling
Issue type
Feature
Difficulty
4/5
Estimated time
3-5 days
Activity status
Active
Clarity
Mostly clear
Newbie friendliness
52/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.