Selene and StyLua Flagging Knit and Related Modules (for custom functions?)

Hello!

  1. What do you want to achieve? I’m getting started with Knit and Rojo, and was mimicking a system used in @sleitnick’s video.

  2. What is the issue? When I try to automatically publish with a push from VS Code, I get a bunch of errors based around the custom functions from knit and related modules (Like beforeAll, afterEach, and andThen.

  3. What solutions have you tried so far? I’ve looked this up and found nobody else with a related problem.

Here’s my yaml file and a screenshot of the explorer:

`deploy_staging.yaml`
name: Deploy_To_Staging

on:
  push:
    branches:
    - main

jobs:

  deploy:
    name: Deploy
    runs-on: ubuntu-latest
    steps:
    - name: Checkout code
      uses: actions/checkout@v3

    - uses: Roblox/setup-foreman@v1
      name: Install Foreman
      with:
        version: "^1.0.0"
        token: ${{ SECRETS.GITHUB_TOKEN }}

    - run: rojo build -o game.rbxl

    - run: rbxcloud experience publish -f game.rbxl -p 10502858237 -u 3821902738 -t published -a ${{ secrets.API_KEY }}


  lint:
    name: Lint
    runs-on: ubuntu-latest
    steps:
    - name: Checkout code
      uses: actions/checkout@v3

    - uses: Roblox/setup-foreman@v1
      name: Install Foreman
      with:
          version: "^1.0.0"
          token: ${{ SECRETS.GITHUB_TOKEN }}

    - name: Lint
      run: |
        selene ./src

  style:
    name: Styling
    runs-on: ubuntu-latest
    steps:
    - uses: actions/checkout@v3
    - uses: JohnnyMorganz/stylua-action@1.0.0
      with:
        token: ${{ secrets.GITHUB_TOKEN }}
        args: --check .
        

Is this a misunderstanding from Selene and StyLua, or am I doing something wrong?
Thanks

Hello!

Ideally, you shouldn’t be putting Packages into your src folder. Packages should remain outside of it. Then you can use Rojo to sync it into ReplicatedStorage still. This will ensure that your CI pipeline doesn’t try to run linting & other checks against vendor/3rd party code.

1 Like

Hello!
I’m seeming to still have trouble with publishing even after removing my packages from src and getting the automatic folder from Wally.
image

In the original linked video at 26:54, your styling check seems to run on the whole folder.
image
This causes my checks to fail because of Knit and related (there’s a lot after this screenshot, this is simply the most I could fit)

So, should I only check in ./src?

Are there any downsides?

And why is this failing?

Is it simply because some of the modules don’t end with a trailing line?

Finally, will the packages be automatically sent to ReplicatedStorage/Packages in my file?

Does this syncing happen automatically, or do I have to add it to default.project.json? (If so, I understand how)
Thanks for the quick response last time. Your videos and your response have been very helpful and inspiring :smiley:

Yeah change Stylua’s args in the YAML file to check against src instead: args: --check ./src

It’s failing because Stylua likes to add spaces between curly braces: {any} gets changed to { any }.

And you’ll have to edit your default.project.json file to point the Packages folder into ReplicatedStorage. It might look something like below (just note the Packages entry).

		"ReplicatedStorage": {
			"$className": "ReplicatedStorage",
			"Source": {
				"$path": "src/ReplicatedStorage"
			},
			"Packages": {
				"$path": "Packages"
			}
		}
1 Like