Skip to content
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

htmlbeautifier: init at 1.3.1 #87928

Draft
wants to merge 2 commits into
base: master
Choose a base branch
from
Draft

Conversation

mveytsman
Copy link
Contributor

@mveytsman mveytsman commented May 16, 2020

Motivation for this change

Adds htmlbeautifier an HTML formatter with Ruby/ERB support.

Things done
  • Tested using sandboxing (nix.useSandbox on NixOS, or option sandbox in nix.conf on non-NixOS linux)
  • Built on platform(s)
    • NixOS
    • macOS
    • other Linux distributions
  • Tested via one or more NixOS test(s) if existing and applicable for the change (look inside nixos/tests)
  • Tested compilation of all pkgs that depend on this change using nix-shell -p nixpkgs-review --run "nixpkgs-review wip"
  • Tested execution of all binary files (usually in ./result/bin/)
  • Determined the impact on package closure size (by running nix path-info -S before and after)
  • Ensured that relevant documentation is up to date
  • Fits CONTRIBUTING.md.

@doronbehar
Copy link
Contributor

Don't know why, but please note that there's a CI evaluation error.

@mveytsman mveytsman force-pushed the htmlbeautifier branch 2 times, most recently from 0d33666 to bf6dcff Compare May 16, 2020 17:56
Comment on lines 5416 to 5419
email = "maxim@ontoillogicmal.com";
github = "mvetsman";
githubId = 34720;
name = "Max Vetsman";
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
email = "maxim@ontoillogicmal.com";
github = "mvetsman";
githubId = 34720;
name = "Max Vetsman";
email = "maxim@ontoillogical.com";
github = "mveytsman";
githubId = 34720;
name = "Max Veytsman";

Copy link
Contributor Author

Choose a reason for hiding this comment

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

<3 thanks @shazow

maintainers/maintainer-list.nix Show resolved Hide resolved
exes = [ "htmlbeautifier" ];

# toString prevents the update script from being copied into the nix store
passthru.updateScript = toString ./update;
Copy link
Contributor

Choose a reason for hiding this comment

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

Question: Do all bundlerApp packages use such an update script? The script it self seems trivial that I doubt there is no generic way of doing so. It seems there is something related to that according to https://nixos.org/nixpkgs/manual/#sec-language-ruby

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I found similar ones in cocoapods but I see some that don't have it, e.g ruby-zoom and solargraph.

Do you think I should remove it?

Copy link
Contributor

Choose a reason for hiding this comment

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

I think cocoapods' update script is a just a bit "non-trivial" because it also handles a Gemfile-beta file for as far as I can see.

Can you try:

  passthru.updateScript = bundlerUpdateScript "htmlbeautifier";

You should be able to check if this works with:

nix-shell maintainers/scripts/update.nix --argstr package htmlbeautifier

See https://nixos.org/nixpkgs/manual/#var-passthru-updateScript

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@doronbehar ah amazing! thanks for clarifying. I changed it as you suggested and it seems to work.

Copy link
Contributor

@kimat kimat May 22, 2020

Choose a reason for hiding this comment

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

Do all bundlerApp packages use such an update script?

Most "simple ruby packages" do, since: #64822.

@mveytsman mveytsman force-pushed the htmlbeautifier branch 2 times, most recently from b42acff to 01fc8d7 Compare May 19, 2020 01:38
Copy link
Contributor

@doronbehar doronbehar left a comment

Choose a reason for hiding this comment

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

LGTM but I'm no experienced in reviewing bundler PRs. Maybe @aanderse will have something more to add.

@aanderse
Copy link
Member

Sorry, I can't be of help... I'm not a ruby guy 😞

@mveytsman
Copy link
Contributor Author

No worries!

Do you know if there's anyone else we should ask for a 👀 on this PR?

@kimat
Copy link
Contributor

kimat commented May 22, 2020

I verified that:

@aanderse
Copy link
Member

aanderse commented Jun 7, 2020

Well... I hate to do it, but I'll bug @manveru for a quick review here.

Copy link
Contributor

@manveru manveru left a comment

Choose a reason for hiding this comment

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

Two small issues, looks good otherwise.

description = "A normaliser/beautifier for HTML that also understands embedded Ruby, ideal for tidying up Rails templates";
homepage = "https://github.com/threedaymonk/htmlbeautifier";
license = licenses.mit;
platforms = platforms.linux;
Copy link
Contributor

Choose a reason for hiding this comment

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

This should probably be ruby.meta.platforms, since it's pure Ruby code and should run everywhere Ruby does?

Comment on lines 6 to 8
gemfile = ./Gemfile;
lockfile = ./Gemfile.lock;
gemset = ./gemset.nix;
Copy link
Contributor

Choose a reason for hiding this comment

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

This can be expressed as gemdir = ./.;

@mveytsman
Copy link
Contributor Author

@manveru I'm really sorry I somehow missed this PR was still open with feedback from you until now ☹️

I went back and addressed your feedback. Is this good to be accepted now?

Sorry again for the hiatus!

@SuperSandro2000
Copy link
Member

@ofborg eval

doronbehar
doronbehar previously approved these changes Mar 24, 2021
Copy link
Contributor

@doronbehar doronbehar left a comment

Choose a reason for hiding this comment

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

your PR should have eventually two commits:

maintainers: add <me>
<package-name>: init at <version>

@stale
Copy link

stale bot commented Sep 21, 2021

I marked this as stale due to inactivity. → More info

@stale stale bot added the 2.status: stale https://github.com/NixOS/nixpkgs/blob/master/.github/STALE-BOT.md label Sep 21, 2021
@doronbehar
Copy link
Contributor

@mveytsman the PR looks good, only the commit log is not as it should be. There should be only two commits:

maintainers: add <me>
<package-name>: init at <version>

@stale stale bot removed the 2.status: stale https://github.com/NixOS/nixpkgs/blob/master/.github/STALE-BOT.md label Sep 23, 2021
@doronbehar doronbehar added the 2.status: stale https://github.com/NixOS/nixpkgs/blob/master/.github/STALE-BOT.md label Sep 23, 2021
@stale stale bot removed the 2.status: stale https://github.com/NixOS/nixpkgs/blob/master/.github/STALE-BOT.md label Sep 23, 2021
@mveytsman
Copy link
Contributor Author

Fixed!

@doronbehar
Copy link
Contributor

Error when testing the binary:

(ins)[nix-shell:~/.cache/nixpkgs-review/pr-87928]$ ./results/htmlbeautifier/bin/htmlbeautifier --help
Traceback (most recent call last):
        3: from ./results/htmlbeautifier/bin/htmlbeautifier:19:in `<main>'
        2: from /nix/store/w25m3pyvypghdi0shx1lg6z1d4g5lhz0-bundler-2.2.24/lib/ruby/gems/2.7.0/gems/bundler-2.2.24/lib/bundler.rb:149:in `setup'
        1: from /nix/store/w25m3pyvypghdi0shx1lg6z1d4g5lhz0-bundler-2.2.24/lib/ruby/gems/2.7.0/gems/bundler-2.2.24/lib/bundler/runtime.rb:13:in `setup'
/nix/store/w25m3pyvypghdi0shx1lg6z1d4g5lhz0-bundler-2.2.24/lib/ruby/gems/2.7.0/gems/bundler-2.2.24/lib/bundler/definition.rb:426:in `ensure_equivalent_gemfile_and_lockfile': You are trying to install in deployment mode after changing (Bundler::ProductionError)
your Gemfile. Run `bundle install` elsewhere and add the
updated ../../../../../nix/store/csw60zvq0rlf0494k86a598hyrh1jjl8-gemfile-and-lockfile/Gemfile.lock to version control.

If this is a development machine, remove the /nix/store/csw60zvq0rlf0494k86a598hyrh1jjl8-gemfile-and-lockfile/Gemfile freeze
by running ``.

The list of sources changed

You have added to the Gemfile:
* source: locally installed gems

@Artturin Artturin marked this pull request as draft May 1, 2022 23:08
@stale stale bot added the 2.status: stale https://github.com/NixOS/nixpkgs/blob/master/.github/STALE-BOT.md label Oct 30, 2022
@stale stale bot removed the 2.status: stale https://github.com/NixOS/nixpkgs/blob/master/.github/STALE-BOT.md label Mar 20, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

10 participants