How to enable Core-Rules in SQL-Fluff and solve TomlDecodeError? - continuous-integration

I want to enable only the core group of rules in SQL-Fluff.
So I added this line to my pyproject.toml file:
[tool.sqlfluff]
rules = "core"
This results in the following error message:
File "C:\Users\User\AppData\Local\Programs\Python\Python310\lib\site-packages\toml\decoder.py", line 134, in load
return loads(ffile.read(), _dict, decoder)
File "C:\Users\User\AppData\Local\Programs\Python\Python310\lib\site-packages\toml\decoder.py", line 478, in loads
raise TomlDecodeError("What? " + group +
toml.decoder.TomlDecodeError: What? rules already exists?{'rules': 'core', 'core': {'dialect': 'tsql', 'exclude_rules': 'L016,L057,L029'}} (line 24 column 1 char 483)
What does this error mean and how do i solve it to achieve my task?

Found the answer myself. I will post it here since i still don't find it intuitive and others may have the same problem.
So, if you only want to use the core set of SQL-Fluff rules, add the following to your pyproject.toml
[tool.sqlfluff.core]
rules = "core"

Related

cqlsh will not run on OS X

I installed Cassandra on Big Sur 11.4 using homebrew, and when I tried to run cqlsh, I received this error.
isaackim#Isaacs-MacBook-Pro bin % cqlsh
Traceback (most recent call last):
File "/usr/local/Cellar/cassandra/3.11.10/libexec/bin/cqlsh.py", line 2458, in <module>
main(*read_options(sys.argv[1:], os.environ))
File "/usr/local/Cellar/cassandra/3.11.10/libexec/bin/cqlsh.py", line 2232, in read_options
configs.read(CONFIG_FILE)
File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/ConfigParser.py", line 305, in read
self._read(fp, filename)
File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/ConfigParser.py", line 512, in _read
raise MissingSectionHeaderError(fpname, lineno, line)
ConfigParser.MissingSectionHeaderError: File contains no section headers.
I previously had Anaconda3 installed, and received the same error (the only difference was the path to cqlsh.py). I thought it might be an issue with Anaconda so I uninstalled Anaconda entirely, then I reinstalled Cassandra using homebrew.
I would appreciate any and all suggestions. Thanks in advance.
Thanks to Alex Ott's suggestion, I managed to replicate the issue you posted by creating a bad ~/.cassandra/cqlshrc configuration file which only contains the following line:
username = alice
As this error suggests:
ConfigParser.MissingSectionHeaderError: File contains no section headers.
the configuration parser detected that there are no section headers in the file. Section headers are line entries enclosed in square brackets ([header_name]). For example:
[authentication]
username = alice
password = Som3Comp7exPa$$word
Review your cqlshrc and make the necessary corrections. If necessary, use the example cqlshrc.sample file in conf/. Cheers!

Sphinx rst2pdf: Numbering figures

I have some documents on Sphinx 2.x. In addition to an HTML version (make html), I want to export it in a PDF version as well, preferably using rst2pdf:
My documents have some figure images. Here's a snippet in index.rst.
.. figure:: ./_images/img01.png
Caption for img01.
.. figure:: ./_images/img02.png
Caption for img02.
I want to add "Figure <#>" in the beginning of every caption. Does anyone have any thoughts? Please note
numfig doesn't work with rst2pdf.
Update (3/22/2020). Add the following lines in conf.py.
numfig = True
numfig_format = {
'figure': 'Figure %s.'
}
numfig_secnum_depth = 1
In the HTML output it works.
In the rst2PDF version, you don't see "Figure #".
The :counter: directive doesn't work with Sphinx; I get the following error:
.. figure:: ./_images/img01.png
Figure :counter:`figure`. Caption for img01.
$ sphinx-build -b pdf ./source/ ./build/
Running Sphinx v2.4.4
/home/sarah/sphinx_test/lib/python3.6/importlib/__init__.py:126: RemovedInSphinx30Warning: sphinx.environment.NoUri is deprecated.
Check CHANGES for Sphinx API modifications.
return _bootstrap._gcd_import(name[level:], package, level)
Initiated sphinxcontrib-images backend: `sphinxcontrib_images_lightbox2.lightbox2:LightBox2`
building [mo]: targets for 0 po files that are out of date
building [pdf]: targets for 1 source files that are out of date
updating environment: [new config] 1 added, 0 changed, 0 removed
reading sources... [100%] index
Exception occurred:
File "/home/sarah/sphinx_test/lib/python3.6/site-packages/docutils/nodes.py", line 439, in copy
return self.__class__(reprunicode(self), rawsource=self.rawsource)
AttributeError: 'CounterNode' object has no attribute 'rawsource'
The full traceback has been saved in /tmp/sphinx-err-1bzghsm6.log, if you want to report the issue to the developers.
Please also report this if it was a user error, so that a better error message can be provided next time.
A bug report can be filed in the tracker at <https://github.com/sphinx-doc/sphinx/issues>. Thanks!

EvanBetterAuthorizationSample Integration Issue

I am trying to store PASSWORD AND SHAREDSECRETKEY in SYSTEM keychain and for that i am using Apple'sEvanBetterAuthorizationSample code.
I tried to use SMJobBlessUtil.py tool.
I tried the 1st function to “setreq” which is giving me error as below.
Traceback (most recent call last):
File "./SMJobBlessUtil.py", line 424, in <module>
main()
File "./SMJobBlessUtil.py", line 418, in main
setreq(appArgs[1], appArgs[2], appArgs[3:])
File "./SMJobBlessUtil.py", line 360, in setreq
appToolDict[bundleID] = toolNameToReqMap[bundleID]
KeyError: ‘myappbundleid'
and then I try check command which is saying me that app code signature invalid.
./SMJobBlessUtil.py check build/Debug/EvenBetterAuthorizationSample.app : app code signature invalid
It looks like there is some thing wrong with my certificates.
I just replace com.example.apple-samplecode.EBAS to my application bundle id everywhere and selected my application’s provisioning profile.
I follow steps from readme file's Adopting this technology Section from EvenBetterAuthorizationSample code as Apple says they are the integration steps but it doesn't looks like steps as i didn't find any proper implementation step.
Can any one guide me in this where else i still need to make changes.
Thanks
Under HelperTool target > Build Settings: Make sure that "Product Name and "Product Module Name" are the same as the Helper Tool identifier.
It was a silly mistake that my Bundle ID and Helper Tool id Does not match and that cause me errors.

Error resurce compiling

I have problem. I add new dialog in old project, and I have some error:
X:MEATFACTORYMaterialsMaterials.rc (22): error RC2135 : file not found: 0x19
X:MEATFACTORYMaterialsMaterials.rc (74): error RC2135 : file not found: 128
X:MEATFACTORYMaterialsMaterials.rc (1764): error RC2104 : undefined keyword or key name: IDC_LIST_RESULT
Error executing rc.exe.
What is it means?
codepage in file - win1251
what do me?
I need resolve this problem only for VC6.0
At all, the cause of this error was that in the process of adding resources VS6.0 then why (why ? This is not understood) has created another new file resourse.h in the expansion which was added two do not read Unicode characters. That is, were present in the directory two files resourse.h - and with different content. When I set up the conditions as compile / c 68001 - then picked up by a file with Unicode but not complete - and that caused a second group of errors. And if the file is compiled as ASCII - from the point of view of the file system at the studio had two files with the same name - and not one of them could not read ( of course). That is, if you get this error - check the file resource.h - and places without glitches such as in this case .
It is also (probably) this is due to the fact that VS works for me on virtualke to Linux - but from the point of view of the file system of Linux is nothing extraordinary - just two files with different names.

How to install the product_images_olbs module in OpenERP 6?

I get the error "No references to product.group_product_manager" when I try to install the module product_images_olbs.
I have an OpenERP V 6.0.2 instance running on Ubuntu 10.04. But it seems I run into a documented error. This error shows up in the client (running on windows) when I want to install some modules:
Environment Information :
System : Windows-2003Server-5.2.3790-SP2
OS Name : nt
Operating System Release : 2003Server
Operating System Version : 5.2.3790
Operating System Architecture : 32bit
Operating System Locale : de_DE.cp1252
Python Version : 2.5.2
OpenERP-Client Version : 6.0.2
Last revision No. & ID :Bazaar Package not Found !Traceback (most recent call last):
File "/usr/share/pyshared/openerp-server/netsvc.py", line 489, in dispatch
result = ExportService.getService(service_name).dispatch(method, auth, params)
File "/usr/share/pyshared/openerp-server/service/web_services.py", line 599, in dispatch
res = fn(db, uid, *params)
File "/usr/share/pyshared/openerp-server/osv/osv.py", line 122, in wrapper
return f(self, dbname, *args, **kwargs)
(...)
File "/usr/share/pyshared/openerp-server/osv/orm.py", line 732, in _get_id
record_id = ir_model_data_obj._get_id(cr, uid, module, xml_id)
File "/usr/share/pyshared/openerp-server/tools/misc.py", line 823, in cached_result
result2 = fn(self2, cr, *args[:self.skiparg-2], **kwargs2)
File "/usr/share/pyshared/openerp-server/addons/base/ir/ir_model.py", line 602, in _get_id
raise ValueError('No references to %s.%s' % (module, xml_id))
ValueError: No references to product.group_product_manager
I was trying to install the product_images_olbs module 6.0.0.1
After some research I found 2 bugreports that seem to fit:
https://bugs.launchpad.net/magentoerpconnect/+bug/695516
https://bugs.launchpad.net/openobject-addons/+bug/695084
Edit: The solution in this case was actually that I have to use the latest version of product_images_olbs.
I thought I was using it but this was not the case, and this was caused by my wrong usage of bazaar. (I come from git but getting used to bazaar more and more ;)
And the accepted answer is correct if applied to the old version of the module.
This is the new version of \addons\product_images_olbs\security\ir.model.access.csv (from revision 5486):
"id","name","model_id:id","group_id:id","perm_read","perm_write","perm_create","perm_unlink"
"access_product_images_olbs_product_images","product_images_olbs_product_images","model_product_images","base.group_sale_manager",1,1,1,1
An old version of the same file:
"id","name","model_id:id","group_id:id","perm_read","perm_write","perm_create","perm_unlink"
"access_product_images_olbs_product_images","product_images_olbs_product_images","model_product_images","product.group_product_manager",1,1,1,1
The old file has references to product.group_product_manager, which is no longer correct for OpenERP 6.0.2
My memory's a bit hazy, but I think that error means that one of the XML files in the module you are trying to install has a reference to a record in the product module with id group_product_manager, but the product module doesn't contain any record with that id.
Do any of the bugs you found have patches or merge proposals? If so, do they help?
One possible solution is to look in the product module and see if that record id was changed to something similar and make the same change in the module you're installing.
Another option is to just remove the reference from the module you're installing. Depending on how it's used, that may or may not cause other problems.
Finally, you could create a record with that id for the new module to use. I think all those references get looked up in the ir_data table, so you could create a new record there.

Resources