-
Notifications
You must be signed in to change notification settings - Fork 45
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat(build): #1094 update formatPython #1106
Conversation
Hi @rohaquinlop, First of all, thank you for this contribution! Now that we're dealing with
Ideally, it would look like this: # makes.nix
{
formatPython = {
strict = {
enabled = true;
config = {
black = ./config/black/strict.toml;
isort = ./config/isort/strict.toml;
};
};
flexible = {
enabled = true;
config = {
black = ./config/black/flexible.toml;
};
};
};
} You can use other builtins like |
@dsalaza4 Got it! I'm gonna work on it. One question, is there any documentation to build from source? |
@rohaquinlop Let's get rid of the |
Ok |
@dsalaza4 I have one question, there will be only these two configurations? Here's my current implementation allowing different configuration names: {
__toModuleOutputs__,
formatPython,
...
}: {
config,
lib,
...
}: let
makeOutput = name: cfg: {
settingsBlack,
settingsIsort,
targets,
}: {
name = "/formatPython/${name}";
value = formatPython {
inherit settingsBlack;
inherit settingsIsort;
inherit targets;
inherit name;
};
};
in {
options = {
formatPython = {
configurations = lib.mkOption {
type = lib.types.attrsOf (lib.types.submodule (_: {
options = {
settingsBlack = lib.mkOption {
default = ./settings-black.toml;
type = lib.types.path;
};
settingsIsort = lib.mkOption {
default = ./settings-isort.toml;
type = lib.types.path;
};
targets = lib.mkOption {
default = ["/"];
type = lib.types.listOf lib.types.str;
};
};
}));
};
};
};
config = {
outputs = __toModuleOutputs__ (lib.mapAttrs' makeOutput config.formatPython.configurations);
};
} And I'm getting the following error:
# makes.nix
{
formatPython = {
strict = {
config = {
targets = ["/"];
};
};
};
} |
@rohaquinlop # makes.nix
{
formatPython = {
my-config-1 = {
config = {
black = ./path-in-my-repo-to-a-config.toml;
isort = ./path-in-my-repo-to-another-config.toml;
};
};
my-config-2 = {
# No configs provided, use default ones
};
};
} |
Regarding the error you're getting, I think the reason is that you have a |
@dsalaza4 I'm getting an error and I can't figure out why is it. Error:
But I already added formatPython to the |
Maybe you're not adding the new files to the repository. Try at least adding all new files to staging with a |
Please update documentation accordingly: https://makes.fluidattacks.com/api/builtins/format/?h=formatp#formatpython You can use |
915fd02
to
d4ccc22
Compare
@rohaquinlop It looks like the DCO of your commit is currently failing: https://github.com/fluidattacks/makes/pull/1106/checks?check_run_id=14193870603 Commit sha: 80e7737, Author: Robin Hafid, Committer: Robin Hafid; Expected "Robin Hafid [email protected]", but got "Robin Hafid Quintero Lopez [email protected]". |
Please add yourself to the mailmap: https://github.com/fluidattacks/makes/actions/runs/5245872757/jobs/9503238429?pr=1106 |
Ok, I'm gonna add me |
@dsalaza4 Done, already updated |
Still failing? You can test with |
- Update formatPython package to use python 3.11 - Separate the arg from evaluator. - Allow having several configurations. - Allow passing isort and black settings to each configuration. Signed-off-by: Robin Quintero <[email protected]>
Kudos, SonarCloud Quality Gate passed! |
Thank you, didn't update the author's commit. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM!
Thank you so much for all your work!
Thank you to, your quick responses and your patience with me in this PR and with #1107 |
Fix #1094