Comments (6)
ruff looks like a great option. It's extremely fast, well-documented, and many big projects use it too. It's also both a linter and formatter. Am currently testing it locally.
from qudi-core.
Most of the remaining linting errors are for bare exceptions, see ea7f854. Need to discuss how best to fix this since I'm not too familiar with the internals. My simple fix now is to just catch the Exception
and log it.
from qudi-core.
I ran ruff check . --ignore=E722
to ignore the errors about bare exceptions. There are 5 remaining errors.
src/qudi/core/gui/main_gui/main_gui.py:409:13: F841 Local variable `process` is assigned to but never used
src/qudi/core/parentpoller.py:101:48: F401 `_winapi.INFINITE` imported but unused; consider using `importlib.util.find_spec` to test for availability
src/qudi/tools/config_editor/config_editor.py:23:1: F822 Undefined name `ConfigurationEditorMainWindow` in `__all__`
src/qudi/util/fit_models/linear.py:66:9: F811 Redefinition of unused `estimate_no_offset` from line 60
src/qudi/util/mapper.py:346:9: F841 Local variable `mapping` is assigned to but never used
Found 5 errors.
No fixes available (2 hidden fixes can be enabled with the `--unsafe-fixes` option).
I don't want to address these yet because I don't know if some behind-the-scenes magic is somehow depending on these. Yet another reason to have unit tests, see #10.
from qudi-core.
I ran ruff format .
in a8eda8a. I hope nothing broke but it should be fine since it's just a formatter. Next would be to start working on unit tests in #10 since that's the next big thing left to do. There's a ton of work to do on formatting, linting and documentation but I think it's better to have a framework for the entire CI/CD first and then work on making everything work.
from qudi-core.
Another thing to decide is whether to have linting and formatting as a CI/CD step or a pre-commit hook. I think it's usually been in CI/CD (I could be wrong) because it used to take so long to run, but now ruff is so fast that a lot of people seem to be able to include it as a pre-commit hook. I think that makes sense too since it's a lot neater if people just commit linted and formatted code.
Of course, if one is in a hurry to push a commit and doesn't want to deal with linting errors, they can (I think) bypass the pre-commit hook using the --no-verify
flag in git. Maybe some bot could then open an issue and yell at the person daily until they fix it.
from qudi-core.
Seems to be appropriate. Just need to decide on a few common changes to the standards (e.g. max line length, double vs single quotes) with the rest of the Qudi team later.
from qudi-core.
Related Issues (11)
- [Bug] RTD build fails due to incomplete dependency specifications HOT 1
- Should we move to Poetry? [New Feature] HOT 3
- Add example code to docs [New Feature]
- Convert all md to rst [Suggestion] HOT 3
- The existing documentation is incompatible with Sphinx [Bug] HOT 1
- The docs take hilariously long to build [Bug] HOT 1
- Sphinx segfault when building docs [Bug]
- Does the license need to be there at the head of almost every file? [Suggestion] HOT 1
- Add unit tests [New Feature] HOT 2
- Github actions caching doesn't seem to work [Bug] HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from qudi-core.