zulip / zulint Goto Github PK
View Code? Open in Web Editor NEWA lightweight linting framework designed for complex applications using a mix of third-party linters and custom rules.
License: Apache License 2.0
A lightweight linting framework designed for complex applications using a mix of third-party linters and custom rules.
License: Apache License 2.0
currently it's possible to match based on multiline patterns. eg 'pattern': r'(\?\>\n.)',
However it is not possible to exclude based that next line content. It would be nice to be able to exclude based on next line(s) matching
It would be great if this could be released on PyPi.
With --fix
, one linter may be writing a file while a second linter is reading it. This may result in the second linter getting a corrupted version. If the second linter then decides to make additional changes, this corruption leaks into the final output.
This unfortunately means we need to run --fix
-aware linters in series when --fix
is enabled.
This repository needs a guidance on code base of the Zulint. Writing proper documentation in the README.md would be good.
Something like these.
See zulip/zulip#13078 (comment) for details
In zulint/custom_rules.py
, theoretically exclude_files_in
can be passed as a parameter when creating a RuleList
, but it's always set as "\\"
no matter what string is passed as a parameter. See code block below.
I'm not sure what the intention was as exclude_files_in
is not listed in the documentation comment "Rule help" as a way to exclude files. There's only one current instance of it's use in zulip/zulip, here.
class RuleList:
"""Defines and runs custom linting rules for the specified language."""
def __init__(
self,
langs: Sequence[str],
rules: Sequence[Rule],
exclude_files_in: Optional[str] = None,
) -> None:
self.langs = langs
self.rules = rules
# Exclude the files in this folder from rules
self.exclude_files_in = "\\"
self.verbose = False
I keep getting this issue when installing from pip, trying multiple Ubuntu machines and python venvs. I get this error:
ERROR: Command errored out with exit status 1:
command: /project/zulinttest/venv/bin/python3 -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'/tmp/pip-install-k5nb2u_7/zulint/setup.py'"'"'; __file__='"'"'/tmp/pip-install-k5nb2u_7/zulint/setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(__file__);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' bdist_wheel -d /tmp/pip-wheel-1eim5wzx
cwd: /tmp/pip-install-k5nb2u_7/zulint/
Complete output (6 lines):
usage: setup.py [global_opts] cmd1 [cmd1_opts] [cmd2 [cmd2_opts] ...]
or: setup.py --help [cmd1 cmd2 ...]
or: setup.py --help-commands
or: setup.py cmd --help
error: invalid command 'bdist_wheel'
----------------------------------------
ERROR: Failed building wheel for zulint
Running setup.py clean for zulint
Failed to build zulint
If I try it again after doing pip install wheel
it works fine. I also tried in my fork setting wheel as required, but this still causes the error. But as wheel did get installed it succeeds the second time of running.
This is being tried in a requirements.txt file using pip3 install -r requirements.txt
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.