Skip to content

tests/emulator: add license, lint with ruff#412

Open
t184256 wants to merge 1 commit into
masterfrom
lint-py
Open

tests/emulator: add license, lint with ruff#412
t184256 wants to merge 1 commit into
masterfrom
lint-py

Conversation

@t184256
Copy link
Copy Markdown
Collaborator

@t184256 t184256 commented Sep 10, 2024

Adds ruff-based linting for python files.

Related to @shelvacu's #393,
where I do appreciate the idea of linting, but I'd like to have it decoupled from script-building time.

Copy link
Copy Markdown
Collaborator

@Gerschtli Gerschtli left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The new formatting LGTM, though I am not that familiar with ruff or its alternatives. But basic linting and formatting is always a good thing :)

Copy link
Copy Markdown

@shelvacu shelvacu left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

minor nitpick but looks good

uses: cachix/install-nix-action@v25

- name: Run ruff linter
run: nix run 'nixpkgs#ruff' -- check
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

in the interest of running the version of ruff we expect to run, shouldn't this point to something in flake.nix? Unfortunately I don't think nix run .#nixpkgs.legacyPackages.x86_64.ruff works but we could expose ruff in the flake and run that.

@t184256
Copy link
Copy Markdown
Collaborator Author

t184256 commented Sep 11, 2024 via email

@Gerschtli
Copy link
Copy Markdown
Collaborator

in the end, a flake check is just a derivation that either ends with touch $out in case of success or with exit 1 in case of error.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants