@@ -0,0 +1,30 @@
1+{ stdenv, python3, fetchFromGitHub, clang-unwrapped }:
2+
3+python3.pkgs.buildPythonApplication rec {
4+ pname = "whatstyle";
5+ version = "0.1.7";
6+ src = fetchFromGitHub {
7+ owner = "mikr";
8+ repo = pname;
9+ rev = "v${version}";
10+ sha256 = "16ak4g149cr764c1lqakiyzmf5s98w8bdc4gk69m8qacimfg3mzm";
11+ };
12+
13+ # Fix references to previous version, to avoid confusion:
14+ postPatch = ''
15+ substituteInPlace setup.py --replace 0.1.6 ${version}
16+ substituteInPlace ${pname}.py --replace 0.1.6 ${version}
17+ '';
18+
19+ checkInputs = [ clang-unwrapped /* clang-format */ ];
20+
21+ doCheck = false; # 3 or 4 failures depending on version, haven't investigated.
22+
23+ meta = with stdenv.lib; {
24+ description = "Find a code format style that fits given source files";
25+ homepage = https://github.com/mikr/whatstyle;
26+ license = licenses.mit;
27+ maintainers = with maintainers; [ dtzWill ];
28+ platforms = platforms.all;
29+ };
30+}