Repository: mrf345/flask_minify (language: python)

Issue:
Static CSS not minifying
I noticed that for some reason, the CSS wasn't minifying. It was auto-added with `app.add_url_rule`. Any reasons, solutions, or stuff I could do to help debug?


Discussion / hints:
Try first to disable the failsafe option `failsafe=False` (it's enabled by default), so you can get an exception. A better approach is to use the Flask app logger to log exceptions even if the failsafe option is enabled, probably I'll add it in a future PR. In this case, we're expecting `lesscpy` package to fail. You can play around with it to figure out what part of your CSS is causing the failure:

https://github.com/mrf345/flask_minify/blob/master/flask_minify/main.py#L7
https://github.com/mrf345/flask_minify/blob/master/flask_minify/main.py#L156-L158
CSS vars don't work. Do you think I could try babel or something?
Probably a babel-polyfill is a good workaround for now. You can open an issue in the [`lesscpy`](https://github.com/lesscpy/lesscpy) repo they might be able to provide a fix for it. It's been a long time since I checked out that codebase, so unfortunately I won't be able to help much there.
> CSS vars don't work. Do you think I could try babel or something?

Not working for me either, unfortunately.

Fix patch:
diff --git a/.flake8 b/.flake8
deleted file mode 100644
index 03782a5..0000000
--- a/.flake8
+++ /dev/null
@@ -1,3 +0,0 @@
-[flake8]
-exclude = .eggs,.nox,.venv,__pycache__,*.pyc
-max-complexity = 20
diff --git a/.travis.yml b/.travis.yml
deleted file mode 100644
index b49b9f4..0000000
--- a/.travis.yml
+++ /dev/null
@@ -1,14 +0,0 @@
-language: python
-python:
-  - "2.7.18"
-  - "3.5.9"
-  - "3.6.10"
-  - "3.7.7"
-  - "3.8.3"
-# command to install dependencies
-install:
-  - pip install -r requirements/test.txt
-# command to run tests
-script: flake8 && pytest
-after_success:
-  - coveralls
diff --git a/LICENSE.txt b/LICENSE.txt
deleted file mode 100644
index 075aba7..0000000
--- a/LICENSE.txt
+++ /dev/null
@@ -1,21 +0,0 @@
-MIT License
-
-Copyright (c) 2017 Mohamed Feddad
-
-Permission is hereby granted, free of charge, to any person obtaining a copy
-of this software and associated documentation files (the "Software"), to deal
-in the Software without restriction, including without limitation the rights
-to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
-copies of the Software, and to permit persons to whom the Software is
-furnished to do so, subject to the following conditions:
-
-The above copyright notice and this permission notice shall be included in all
-copies or substantial portions of the Software.
-
-THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
-IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
-FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
-AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
-LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
-OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
-SOFTWARE.
diff --git a/flask_minify/about.py b/flask_minify/about.py
index a19a37c..41986df 100644
--- a/flask_minify/about.py
+++ b/flask_minify/about.py
@@ -1,4 +1,4 @@
-__version__ = "0.32"
+__version__ = "0.33"
 __doc__ = "Flask extension to minify html, css, js and less."
 __license__ = "MIT"
 __author__ = "Mohamed Feddad"


Test patch:
diff --git a/tests/constants.py b/tests/constants.py
index ec97226..b459ddb 100644
--- a/tests/constants.py
+++ b/tests/constants.py
@@ -55,9 +55,13 @@
 """
 
 CSS_EDGE_CASES = """
+:root {
+  --main-bg-color: brown;
+}
+
 .some-class {
     color: rgba(202, 242, 255, 1);
-
+    background-color: var(--main-bg-color);
 }
 
 #some-id {
@@ -96,7 +100,8 @@
 MINIFIED_JS_TEMPLATE_LITERALS = "const a='something';const b=` more  than    ${a}  `;"
 
 MINIFIED_CSS_EDGE_CASES = (
-    ".some-class{color:rgba(202,242,255,1)}#some-id{grid-area:1 / 2 / 2 / 3}"
+    ":root{--main-bg-color:brown}.some-class{color:rgba(202,242,255,1);"
+    "background-color:var(--main-bg-color)}#some-id{grid-area:1 / 2 / 2 / 3}"
 )
 
 MINIFED_HTML_EMBEDDED_TAGS = bytes(