···11-{ lib, buildPythonPackage, fetchPypi }:
11+{ lib
22+, buildPythonPackage
33+, fetchPypi
44+, nose
55+}:
2637buildPythonPackage rec {
48 pname = "yapf";
55- version = "0.30.0";
99+ version = "0.31.0";
610711 src = fetchPypi {
812 inherit pname version;
99- sha256 = "3000abee4c28daebad55da6c85f3cd07b8062ce48e2e9943c8da1b9667d48427";
1313+ hash = "sha256-QI+5orJUwwL0nbg8WfmqC0sP0OwlvjpcURgTJ5Iv9j0=";
1014 };
11151616+ checkInputs = [
1717+ nose
1818+ ];
1919+1220 meta = with lib; {
1313- description = "A formatter for Python code.";
1414- homepage = "https://github.com/google/yapf";
1515- license = licenses.asl20;
1616- maintainers = with maintainers; [ siddharthist ];
2121+ homepage = "https://github.com/google/yapf";
2222+ description = "Yet Another Python Formatter";
2323+ longDescription = ''
2424+ Most of the current formatters for Python --- e.g., autopep8, and pep8ify
2525+ --- are made to remove lint errors from code. This has some obvious
2626+ limitations. For instance, code that conforms to the PEP 8 guidelines may
2727+ not be reformatted. But it doesn't mean that the code looks good.
2828+2929+ YAPF takes a different approach. It's based off of 'clang-format',
3030+ developed by Daniel Jasper. In essence, the algorithm takes the code and
3131+ reformats it to the best formatting that conforms to the style guide, even
3232+ if the original code didn't violate the style guide. The idea is also
3333+ similar to the 'gofmt' tool for the Go programming language: end all holy
3434+ wars about formatting - if the whole codebase of a project is simply piped
3535+ through YAPF whenever modifications are made, the style remains consistent
3636+ throughout the project and there's no point arguing about style in every
3737+ code review.
3838+3939+ The ultimate goal is that the code YAPF produces is as good as the code
4040+ that a programmer would write if they were following the style guide. It
4141+ takes away some of the drudgery of maintaining your code.
4242+ '';
4343+ license = licenses.asl20;
4444+ maintainers = with maintainers; [ AndersonTorres siddharthist ];
1745 };
1818-1946}