Skip to content

Commit

Permalink
refac(back): fluidattacks#1378 deprecate format python
Browse files Browse the repository at this point in the history
- Deprecate formatPython as it was replaced by ruff
- Remove documentation
- Remove CI jobs

Signed-off-by: Daniel Salazar <[email protected]>
  • Loading branch information
dsalaza4 committed Dec 13, 2024
1 parent aead72f commit faf7528
Show file tree
Hide file tree
Showing 11 changed files with 0 additions and 172 deletions.
16 changes: 0 additions & 16 deletions .github/workflows/dev.yml
Original file line number Diff line number Diff line change
Expand Up @@ -119,22 +119,6 @@ jobs:
- name: /formatNix
run: nix-env -if . && m . /formatNix

linux_formatPython:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@f095bcc56b7c2baf48f3ac70d6d6782f4f553222
- uses: docker://docker.io/nixos/nix@sha256:c3db4c484f6b1ee6c9bb8ca90307cfbeca8ef88156840911356a677eeaff4845
name: /formatPython/default
with:
args: sh -c "chown -R root:root /github/workspace && nix-env -if . && m . /formatPython/default"
macos_formatPython:
runs-on: macos-latest
steps:
- uses: actions/checkout@f095bcc56b7c2baf48f3ac70d6d6782f4f553222
- uses: cachix/install-nix-action@6ed004b9ccb68dbc28e7c85bee15fa93dbd214ac
- name: /formatPython/default
run: nix-env -if . && m . /formatPython/default

linux_formatTerraform:
runs-on: ubuntu-latest
steps:
Expand Down
20 changes: 0 additions & 20 deletions .github/workflows/prod.yml
Original file line number Diff line number Diff line change
Expand Up @@ -225,26 +225,6 @@ jobs:
env:
CACHIX_AUTH_TOKEN: ${{ secrets.CACHIX_AUTH_TOKEN }}

linux_formatPython:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@f095bcc56b7c2baf48f3ac70d6d6782f4f553222
- uses: docker://docker.io/nixos/nix@sha256:c3db4c484f6b1ee6c9bb8ca90307cfbeca8ef88156840911356a677eeaff4845
name: /formatPython/default
with:
args: sh -c "chown -R root:root /github/workspace && nix-env -if . && m . /formatPython/default"
env:
CACHIX_AUTH_TOKEN: ${{ secrets.CACHIX_AUTH_TOKEN }}
macos_formatPython:
runs-on: macos-latest
steps:
- uses: actions/checkout@f095bcc56b7c2baf48f3ac70d6d6782f4f553222
- uses: cachix/install-nix-action@6ed004b9ccb68dbc28e7c85bee15fa93dbd214ac
- name: /formatPython/default
run: nix-env -if . && m . /formatPython/default
env:
CACHIX_AUTH_TOKEN: ${{ secrets.CACHIX_AUTH_TOKEN }}

linux_formatTerraform:
runs-on: ubuntu-latest
steps:
Expand Down
44 changes: 0 additions & 44 deletions docs/src/api/builtins/format.md
Original file line number Diff line number Diff line change
Expand Up @@ -114,50 +114,6 @@ Example:
m . /formatNix
```

## formatPython

Ensure that Python code is formatted
according to [Black](https://github.com/psf/black)
and [isort](https://github.com/PyCQA/isort).

Types:

- formatPython (`attrsOf targetType`): Optional.
Mapping of names to format targets.
Defaults to `{ }`.
- targetType (`submodule`):
- config (`atrrs`): Optional.
- black (`path`): Optional.
Path to the Black configuration file.
Defaults to [./settings-black.toml](https://github.com/fluidattacks/makes/blob/main/src/evaluator/modules/format-python/settings-black.toml).
- isort (`path`): Optional.
Path to the isort configuration file.
Defaults to [./settings-isort.toml](https://github.com/fluidattacks/makes/blob/main/src/evaluator/modules/format-python/settings-isort.toml).
- targets (`listOf str`): Optional.
Files or directories (relative to the project) to format.
Defaults to the entire project.

Example:

=== "makes.nix"

```nix
{
formatPython = {
my-config = {
targets = ["/"];
config = {};
};
};
}
```

=== "Invocation"

```bash
m . /formatPython/my-config
```

## formatTerraform

Ensure that Terraform code is formatted
Expand Down
1 change: 0 additions & 1 deletion makes.nix
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,6 @@
enable = true;
targets = [ "/" ];
};
formatPython = { default = { targets = [ "/" ]; }; };
formatTerraform = {
enable = true;
targets = [ "/" ];
Expand Down
1 change: 0 additions & 1 deletion src/args/agnostic.nix
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,6 @@ let
inherit (__nixpkgs__.lib.lists) flatten;
formatBash = import ./format-bash/default.nix self;
formatNix = import ./format-nix/default.nix self;
formatPython = import ./format-python/default.nix self;
formatTerraform = import ./format-terraform/default.nix self;
formatYaml = import ./format-yaml/default.nix self;
fromJson = builtins.fromJSON;
Expand Down
16 changes: 0 additions & 16 deletions src/args/format-python/default.nix

This file was deleted.

22 changes: 0 additions & 22 deletions src/args/format-python/entrypoint.sh

This file was deleted.

1 change: 0 additions & 1 deletion src/evaluator/modules/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@
(import ./format-bash/default.nix args)
(import ./format-markdown/default.nix args)
(import ./format-nix/default.nix args)
(import ./format-python/default.nix args)
(import ./format-terraform/default.nix args)
(import ./format-yaml/default.nix args)
(import ./hello-world/default.nix args)
Expand Down
37 changes: 0 additions & 37 deletions src/evaluator/modules/format-python/default.nix

This file was deleted.

3 changes: 0 additions & 3 deletions src/evaluator/modules/format-python/settings-black.toml

This file was deleted.

11 changes: 0 additions & 11 deletions src/evaluator/modules/format-python/settings-isort.toml

This file was deleted.

0 comments on commit faf7528

Please sign in to comment.